Disable duplicated caching
Previously, setup-go and a dedicated cache action were used for each run. This yielded errors, since the file to be restored already existed.
This commit is contained in:

committed by
Maximilian Paß

parent
60867e9214
commit
80b8c27924
28
.github/workflows/ci.yml
vendored
28
.github/workflows/ci.yml
vendored
@ -23,14 +23,6 @@ jobs:
|
|||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
- uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cache/go-build
|
|
||||||
~/go/pkg/mod
|
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
- name: Update last trim for Go build cache
|
- name: Update last trim for Go build cache
|
||||||
# Go usually trims all builds not used for at least five days. We simulate that the last trim just occurred recently.
|
# Go usually trims all builds not used for at least five days. We simulate that the last trim just occurred recently.
|
||||||
# Otherwise, the cache restored in the previous step would not be used for the build resulting in a longer workflow run.
|
# Otherwise, the cache restored in the previous step would not be used for the build resulting in a longer workflow run.
|
||||||
@ -66,6 +58,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: --timeout=3m
|
args: --timeout=3m
|
||||||
|
# We rely on the setup-go action to cache the Go pkg and build directories.
|
||||||
|
skip-pkg-cache: true
|
||||||
|
skip-build-cache: true
|
||||||
|
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -76,14 +71,6 @@ jobs:
|
|||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
- uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cache/go-build
|
|
||||||
~/go/pkg/mod
|
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
- name: Update last trim for Go build cache
|
- name: Update last trim for Go build cache
|
||||||
# Go usually trims all builds not used for at least five days. We simulate that the last trim just occurred recently.
|
# Go usually trims all builds not used for at least five days. We simulate that the last trim just occurred recently.
|
||||||
# Otherwise, the cache restored in the previous step would not be used for the build resulting in a longer workflow run.
|
# Otherwise, the cache restored in the previous step would not be used for the build resulting in a longer workflow run.
|
||||||
@ -142,15 +129,6 @@ jobs:
|
|||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
- name: Cache Go modules
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cache/go-build
|
|
||||||
~/go/pkg/mod
|
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
- name: Update last trim for Go build cache
|
- name: Update last trim for Go build cache
|
||||||
# Go usually trims all builds not used for at least five days. We simulate that the last trim just occurred recently.
|
# Go usually trims all builds not used for at least five days. We simulate that the last trim just occurred recently.
|
||||||
# Otherwise, the cache restored in the previous step would not be used for the build resulting in a longer workflow run.
|
# Otherwise, the cache restored in the previous step would not be used for the build resulting in a longer workflow run.
|
||||||
|
Reference in New Issue
Block a user