Skip to content

Commit

Permalink
fix(ci): Build each system in separate job
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones2014 committed Jan 7, 2025
1 parent 9480168 commit ac8065c
Showing 1 changed file with 43 additions and 22 deletions.
65 changes: 43 additions & 22 deletions .github/workflows/nix-build-and-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,59 @@ on:
- 'automation/**'
- 'dependabot/**'
jobs:
tests-pass:
name: all systems go
build-macos-home-manager:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
accept-flake-config = true
- uses: cachix/cachix-action@v15
with:
name: mrjones2014-dotfiles
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: build all definitions
run: nix run github:Mic92/nix-fast-build -L -- --skip-cached --no-download --no-nom --eval-workers 1 --eval-max-memory-size 2048 --flake .#mac
build-nixos-server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
accept-flake-config = true
- uses: cachix/cachix-action@v15
with:
name: mrjones2014-dotfiles
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: build all definitions
run: nix run github:Mic92/nix-fast-build -L -- --skip-cached --no-download --no-nom --eval-workers 1 --eval-max-memory-size 2048 --flake .#server
build-nixos-pc:
runs-on: ubuntu-latest
if: ${{ always() && contains(needs.*.result, 'failure') }}
steps:
- run: exit 1
needs:
- tests

tests:
strategy:
# Allow other jobs to finish building and cache properly before bailing
fail-fast: false
matrix:
include:
- os: macos-15 # for macOS home-manager
- os: ubuntu-latest
system: "x86_64-linux"

runs-on: ${{ matrix.os }}
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
accept-flake-config = true
- uses: cachix/cachix-action@v15
with:
name: mrjones2014-dotfiles
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: build all definitions
run: nix run github:Mic92/nix-fast-build -L -- --skip-cached --no-download --no-nom --eval-workers 1 --eval-max-memory-size 2048 --flake .#pc
build-nixos-laptop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
extra-platforms = ${{ matrix.extraPlatforms }}
accept-flake-config = true
- uses: cachix/cachix-action@v15
with:
name: mrjones2014-dotfiles
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Add nix-community cache
run: cachix use nix-community
- name: build all definitions
run: nix run github:Mic92/nix-fast-build -L -- --skip-cached --no-download --no-nom --eval-workers 1 --eval-max-memory-size 2048 --flake .#checks.${{ matrix.system }}
run: nix run github:Mic92/nix-fast-build -L -- --skip-cached --no-download --no-nom --eval-workers 1 --eval-max-memory-size 2048 --flake .#laptop

0 comments on commit ac8065c

Please sign in to comment.