CI: Update cache paths.

This commit is contained in:
Joachim Bauch 2022-04-05 10:32:03 +02:00
parent 320f643a87
commit b066785b00
No known key found for this signature in database
GPG key ID: 77C1D22D53E15F02
2 changed files with 32 additions and 3 deletions

View file

@ -19,6 +19,23 @@ jobs:
continue-on-error: true
steps:
- uses: actions/checkout@v3
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
echo "::set-output name=go-version::$(go version | cut -d ' ' -f 3)"
- name: Go build cache
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-${{ steps.go-cache-paths.outputs.go-version }}-build-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Go mod cache
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-${{ steps.go-cache-paths.outputs.go-version }}-mod-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Install dependencies
run: |

View file

@ -30,11 +30,23 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- name: Cache dependencies
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
echo "::set-output name=go-version::$(go version | cut -d ' ' -f 3)"
- name: Go build cache
uses: actions/cache@v3
with:
path: vendor/
key: vendor-${{ matrix.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-${{ steps.go-cache-paths.outputs.go-version }}-build-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Go mod cache
uses: actions/cache@v3
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-${{ steps.go-cache-paths.outputs.go-version }}-mod-${{ hashFiles('**/go.mod', '**/go.sum') }}
- name: Build applications
run: |