Skip to content

Commit

Permalink
fix: race/fuzz test build cache restore (#15075)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikburt authored Nov 1, 2024
1 parent e6817ea commit cc5ba93
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ inputs:
Only restore the module cache, don't automatically update it.
Leave the updating to go-mod-cache.yml.
default: "true"
restore-build-cache-only:
description: |
Only restore the build cache, don't automatically update/upload it.
default: "false"

runs:
using: composite
Expand Down Expand Up @@ -81,7 +85,7 @@ runs:
- uses: actions/cache/[email protected]
name: Cache Go Build Outputs (restore)
# For certain events, we don't necessarily want to create a build cache, but we will benefit from restoring from one.
if: ${{ inputs.only-modules == 'false' && github.event == 'merge_group' }}
if: ${{ inputs.only-modules == 'false' && (github.event == 'merge_group' || inputs.restore-build-cache-only == 'true') }}
with:
path: |
${{ steps.go-cache-dir.outputs.gobuildcache }}
Expand All @@ -93,8 +97,8 @@ runs:
${{ runner.os }}-gobuild-${{ inputs.cache-version }}-
- uses: actions/[email protected]
# don't save cache on merge queue events, only restore
if: ${{ inputs.only-modules == 'false' && github.event != 'merge_group' }}
# don't save cache on merge queue events
if: ${{ inputs.only-modules == 'false' && (github.event != 'merge_group' && inputs.restore-build-cache-only == 'false') }}
name: Cache Go Build Outputs
with:
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ jobs:
if: ${{ needs.filter.outputs.changes == 'true' }}
uses: ./.github/actions/setup-go
with:
# race/fuzz tests don't benefit from build caching
only-modules: ${{ matrix.type.cmd == 'go_core_race_tests' || matrix.type.cmd == 'go_core_fuzz' }}
# race/fuzz tests don't benefit repeated caching, so restore from develop's build cache
restore-build-cache-only: ${{ matrix.type.cmd == 'go_core_race_tests' || matrix.type.cmd == 'go_core_fuzz' }}
build-cache-version: ${{ matrix.type.cmd }}

- name: Replace chainlink-evm deps
Expand Down

0 comments on commit cc5ba93

Please sign in to comment.