Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: simplfy go cache key resolution #4552

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ jobs:
# graph is the same, however each job results in different dependencies being downloaded and the first one
# to finish wins with regards to saving the cache. To workaround, we create a file to include in the graph
# that contains information specified to the workflow & job so that each job gets a separate go cache.
# Note that the cache key used (https://github.com/actions/setup-go/blob/main/src/cache-restore.ts#L35) by
# actions/setup-go is already platform/arch/go-version specific so we only need to further differentiate
# by workflow and job.
- name: Create go cache info file
run: echo "go-cache-${{ github.workflow }}-${{ github.job }}-${{ runner.os }}" > ${GO_CACHE_INFO_FILE}
run: echo "go-cache-${{ github.workflow }}-${{ github.job }}" > ${GO_CACHE_INFO_FILE}

- name: Setup go
uses: actions/setup-go@v5
Expand Down Expand Up @@ -174,8 +177,11 @@ jobs:
# graph is the same, however each job results in different dependencies being downloaded and the first one
# to finish wins with regards to saving the cache. To workaround, we create a file to include in the graph
# that contains information specified to the workflow & job so that each job gets a separate go cache.
# Note that the cache key used (https://github.com/actions/setup-go/blob/main/src/cache-restore.ts#L35) by
# actions/setup-go is already platform/arch/go-version specific so we only need to further differentiate
# by workflow and job.
- name: Create go cache info file
run: echo "go-cache-${{ github.workflow }}-${{ github.job }}-${{ runner.os }}" > ${GO_CACHE_INFO_FILE}
run: echo "go-cache-${{ github.workflow }}-${{ github.job }}" > ${GO_CACHE_INFO_FILE}

- name: Setup go
uses: actions/setup-go@v5
Expand Down
Loading