Update last trim for Go build cache

This commit is contained in:
Sebastian Serth
2021-11-11 00:12:10 +01:00
parent ac6ce56c38
commit dd91f696a1

View File

@ -28,6 +28,11 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: | restore-keys: |
${{ runner.os }}-go- ${{ runner.os }}-go-
- 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.
# Otherwise, the cache restored in the previous step would not be used for the build resulting in a longer workflow run.
# More details: https://github.com/golang/go/blob/d60ad1e068263832c711aaf17b6ccb1b7f71b000/src/cmd/go/internal/cache/cache.go#L255-L326
run: date +%s > ~/.cache/go-build/trim.txt
- name: Build - name: Build
run: make build run: make build
- name: Upload Poseidon binary - name: Upload Poseidon binary
@ -63,6 +68,11 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: | restore-keys: |
${{ runner.os }}-go- ${{ runner.os }}-go-
- 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.
# Otherwise, the cache restored in the previous step would not be used for the build resulting in a longer workflow run.
# More details: https://github.com/golang/go/blob/d60ad1e068263832c711aaf17b6ccb1b7f71b000/src/cmd/go/internal/cache/cache.go#L255-L326
run: date +%s > ~/.cache/go-build/trim.txt
- name: Run tests - name: Run tests
run: make coverhtml run: make coverhtml
- name: Upload coverage report - name: Upload coverage report
@ -108,6 +118,11 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: | restore-keys: |
${{ runner.os }}-go- ${{ runner.os }}-go-
- 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.
# Otherwise, the cache restored in the previous step would not be used for the build resulting in a longer workflow run.
# More details: https://github.com/golang/go/blob/d60ad1e068263832c711aaf17b6ccb1b7f71b000/src/cmd/go/internal/cache/cache.go#L255-L326
run: date +%s > ~/.cache/go-build/trim.txt
- name: Cache Nomad binary - name: Cache Nomad binary
uses: actions/cache@v2 uses: actions/cache@v2
with: with: