ci: upload nix outputs to cachix

This commit is contained in:
Simon Scatton
2026-06-24 11:24:52 +02:00
parent 86c1deed89
commit 1daafb95ee
2 changed files with 39 additions and 16 deletions
+30 -16
View File
@@ -12,7 +12,6 @@ on:
permissions:
contents: read
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -46,12 +45,17 @@ jobs:
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
accept-flake-config = true
- name: Enable Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build package
run: nix build ".#packages.${{ matrix.target.system }}.${{ matrix.package }}" --no-link --no-update-lock-file
- name: Build and upload package
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
run: |
: "${CACHIX_AUTH_TOKEN:?CACHIX_AUTH_TOKEN is required to upload to Cachix}"
nix run --inputs-from . nixpkgs#cachix -- watch-exec openshell -- \
nix build ".#packages.${{ matrix.target.system }}.${{ matrix.package }}" --no-link --no-update-lock-file
test:
name: Test ${{ matrix.check }} (${{ matrix.target.system }})
@@ -88,12 +92,17 @@ jobs:
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
accept-flake-config = true
- name: Enable Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Run test
run: nix build ".#checks.${{ matrix.target.system }}.${{ matrix.check }}" --no-link --no-update-lock-file
- name: Run and upload test
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
run: |
: "${CACHIX_AUTH_TOKEN:?CACHIX_AUTH_TOKEN is required to upload to Cachix}"
nix run --inputs-from . nixpkgs#cachix -- watch-exec openshell -- \
nix build ".#checks.${{ matrix.target.system }}.${{ matrix.check }}" --no-link --no-update-lock-file
lint:
name: Lint ${{ matrix.lint }} (${{ matrix.target.system }})
@@ -131,9 +140,14 @@ jobs:
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
accept-flake-config = true
- name: Enable Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Run lint
run: nix build ".#checks.${{ matrix.target.system }}.${{ matrix.lint }}" --no-link --no-update-lock-file
- name: Run and upload lint
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
run: |
: "${CACHIX_AUTH_TOKEN:?CACHIX_AUTH_TOKEN is required to upload to Cachix}"
nix run --inputs-from . nixpkgs#cachix -- watch-exec openshell -- \
nix build ".#checks.${{ matrix.target.system }}.${{ matrix.lint }}" --no-link --no-update-lock-file