From c850419c580ca32f58688d30253a07b4690cdb17 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Fri, 27 May 2022 10:30:07 +0100 Subject: [PATCH] Only cache nix store --- .github/workflows/build.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cee6ef65..058b17c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: if: steps.changed-files.outputs.any_changed == 'true' with: path: | - /nix + /nix/store key: ${{ runner.os }}-nix-${{ hashFiles('**/flake.lock') }} restore-keys: | ${{ runner.os }}-nix- @@ -46,23 +46,16 @@ jobs: echo "::set-output name=go-build::$(nix develop --command -- go env GOCACHE)" echo "::set-output name=go-mod::$(nix develop --command -- go env GOMODCACHE)" - - name: Go Build Cache + - name: Go Cache uses: actions/cache@v3 if: steps.changed-files.outputs.any_changed == 'true' with: - path: ${{ steps.go-cache-paths.outputs.go-build }} - key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go-build- - - - name: Go Mod Cache - uses: actions/cache@v3 - if: steps.changed-files.outputs.any_changed == 'true' - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} + path: | + ${{ steps.go-cache-paths.outputs.go-mod }} + ${{ steps.go-cache-paths.outputs.go-build }} key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} restore-keys: | - ${{ runner.os }}-go-mod- + ${{ runner.os }}-go- - name: Run build if: steps.changed-files.outputs.any_changed == 'true'