diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2daf176..0c228e4f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,8 +49,6 @@ jobs: name: Test runs-on: ubuntu-latest steps: - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - name: Sync repository uses: actions/checkout@v4 @@ -66,13 +64,7 @@ jobs: exit 1 fi - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main - with: - diagnostic-endpoint: "" - extra-conf: | - experimental-features = nix-command flakes - accept-flake-config = true + - uses: nixbuild/nix-quick-install-action@v27 - name: Enable Cachix binary cache run: | @@ -80,18 +72,36 @@ jobs: cachix use crane cachix use nix-community - - name: Configure Magic Nix Cache - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Restore and cache Nix store + uses: nix-community/cache-nix-action@v5 with: - diagnostic-endpoint: "" - upstream-cache: "https://cache.nixos.org" + # restore and save a cache using this key + primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix') }} + # if there's no cache hit, restore a cache by this prefix + restore-prefixes-first-match: nix-${{ runner.os }}- + # collect garbage until Nix store size (in bytes) is at most this number + # before trying to save a new cache + gc-max-store-size-linux: 1073741824 + # do purge caches + purge: true + # purge all versions of the cache + purge-prefixes: cache-${{ runner.os }}- + # created more than this number of seconds ago relative to the start of the `Post Restore` phase + purge-created: 0 + # except the version with the `primary-key`, if it exists + purge-primary-key: never - name: Apply Nix binary cache configuration run: | + echo "before: " && cat /etc/nix/nix.conf + cat /etc/nix/nix.conf sudo tee -a /etc/nix/nix.conf > /dev/null <