From 03f98b7423f1197feb2fc41bfa50284c0ffd5145 Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Wed, 15 Nov 2023 18:35:43 +0000 Subject: [PATCH] Use GitHub Actions cache with Nix --- .github/workflows/ci.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22e317d2..a9dfcff9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v20 + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v7 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + + # Evaluate the devshell here so that the time reported for subsequent + # steps that use it reflect what is actually done there. + - name: Evaluate devshell + run: nix develop - name: Format run: nix develop --command treefmt --fail-on-change @@ -47,8 +53,14 @@ jobs: - trace-to-events steps: - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v20 + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v7 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + + # Evaluate the devshell here so that the time reported for subsequent + # steps that use it reflect what is actually done there. + - name: Evaluate devshell + run: nix develop - name: Build run: nix build -L .#${{ matrix.package }}