Skip to content

Commit

Permalink
ci: add package and nixos config builds
Browse files Browse the repository at this point in the history
Only 1 package and 0 nixos configurations where being built in CI. Now
they all are.
  • Loading branch information
djacu committed Sep 22, 2024
1 parent 49b1c8b commit fcd3946
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
- master
workflow_dispatch:
jobs:
validate_datafiles:
name: ci_core
nix_checks:
name: nix checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -18,4 +18,43 @@ jobs:
- run: nix build -L .#checks.x86_64-linux.perl-switches
- run: nix build -L .#checks.x86_64-linux.openwrt-golden
- run: nix build -L .#checks.x86_64-linux.formatting
nix_builds:
name: nix builds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix build -L .#massflash
- run: nix build -L .#scaleInventory
- run: nix build -L .#serverspec
nixos_configs_get:
name: nixos configurations get name
runs-on: ubuntu-latest
outputs:
nixosconfignames: ${{ steps.nixosconfigsget.outputs.nixosconfignames }}
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Get all NixOS configurations
id: nixosconfigsget
run: |
nixosconfignames=$(nix eval .\#nixosConfigurations --apply builtins.attrNames --json)
echo "$nixosconfignames"
echo "nixosconfignames=$nixosconfignames" >> $GITHUB_OUTPUT
nixos_configs_build:
name: build ${{ matrix.configName }} nixos configuration
needs: nixos_configs_get
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
configName: ${{ fromJSON(needs.nixos_configs_get.outputs.nixosconfignames) }}
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build ${{ matrix.configName }} nixos configuration
run: |
nix build -L .#nixosConfigurations.${{ matrix.configName }}.config.system.build.toplevel

0 comments on commit fcd3946

Please sign in to comment.