ci: use nixci and proper caching

Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
Harald Hoyer 2024-03-22 08:33:11 +01:00
parent e1116e9487
commit f36ef2047c
Signed by: harald
GPG key ID: F519A1143B3FBE32

View file

@ -11,39 +11,55 @@ concurrency:
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
with:
extra_nix_config: |
access-tokens = github.com=${{ github.token }}
- run: nix flake check -L --show-trace --keep-going
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
with:
extra_nix_config: |
access-tokens = github.com=${{ github.token }}
- run: nix fmt
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: cachix/install-nix-action@v26
with:
extra_nix_config: |
access-tokens = github.com=${{ github.token }}
- uses: cachix/cachix-action@v14
continue-on-error: true
with:
name: nixsgx
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Enable magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build
run: nix build -L
- run: nix fmt . -- --check
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: cachix/install-nix-action@v26
with:
extra_nix_config: |
access-tokens = github.com=${{ github.token }}
- uses: cachix/cachix-action@v14
with:
name: nixsgx
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Enable magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix flake check -L --show-trace --keep-going
build:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: cachix/install-nix-action@v26
with:
extra_nix_config: |
access-tokens = github.com=${{ github.token }}
- uses: cachix/cachix-action@v14
with:
name: nixsgx
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Enable magic Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: nix build
run: nix run nixpkgs#nixci