diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3bcf070f..2ba1d656 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,11 @@ jobs: runs-on: ubuntu-latest steps: + - id: go-cache-paths + run: | + echo "::set-output name=go-build::$(go env GOCACHE)" + echo "::set-output name=go-mod::$(go env GOMODCACHE)" + - uses: actions/checkout@v2 with: fetch-depth: 2 @@ -28,15 +33,18 @@ jobs: integration_test/ config-example.yaml - - uses: actions/cache@v3 + - name: Go Build Cache + uses: actions/cache@v3 if: steps.changed-files.outputs.any_changed == 'true' with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + path: ${{ steps.go-cache-paths.outputs.go-build }} + key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} + + - name: Go Mod Cache + uses: actions/cache@v2 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - uses: cachix/install-nix-action@v16 if: steps.changed-files.outputs.any_changed == 'true'