diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml index 1fd318b..72837e3 100644 --- a/.forgejo/workflows/check.yml +++ b/.forgejo/workflows/check.yml @@ -7,6 +7,15 @@ jobs: steps: - name: Check out repository code uses: https://code.forgejo.org/actions/checkout@v4 + - name: "Cache Nix store" + uses: actions/cache@v3.3.2 + id: nix-cache + with: + path: /tmp/nixcache + key: "cache-nix-store" + - name: "Import Nix store cache" + if: "steps.nix-cache.outputs.cache-hit == 'true'" + run: "nix-store --import < /tmp/nixcache" - name: Prepare cachix uses: https://github.com/cachix/cachix-action@v12 with: @@ -15,3 +24,6 @@ jobs: - name: Run flake checks run: | nix --print-build-logs --verbose --accept-flake-config flake check + - name: "Export Nix store cache" + if: "steps.nix-cache.outputs.cache-hit != 'true'" + run: "nix-store --export $(find /nix/store -maxdepth 1 -name '*-*') > /tmp/nixcache"