-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Do not merge, non-draft for workflow testing: ci: fix test caching, use consistent Go version #19223
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
Open
anacrolix
wants to merge
66
commits into
main
Choose a base branch
from
anacrolix/all-tests-caching
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Do not merge, non-draft for workflow testing: ci: fix test caching, use consistent Go version #19223
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
d99a026
ci: improve caching, test filtering, and workflow consolidation
anacrolix a099a0d
Remove unnecessary action name overrides
anacrolix f1a3bf1
ci: refactor kurtosis-assertoor workflow to use matrix strategy
anacrolix 66e11db
ci: consolidate checkout into setup-erigon, restore file mtimes from …
anacrolix 33786f6
ci: use git parent commit for cache restore, simplify save key
anacrolix 4010dea
Meat popsicle cleanup
anacrolix 0612ca6
ci: use workflow filename instead of name in cache keys
anacrolix d9fa772
ci: add test cache statistics to job summaries
anacrolix 85ba89e
ci: continue on errors in test-caching rerun script
anacrolix 7ca0e06
meat popsicle
anacrolix 509aabd
meat popsicle
anacrolix eb90044
ci: fix git curl verbose output in non-debug CI runs
anacrolix 24b9ca8
meat popsicle
anacrolix 1a508ed
execution/tests: split 4 slowest EEST blockchain subtests into separa…
anacrolix 55c263b
ci: split slow EEST blockchain tests into separate race-test matrix jobs
anacrolix 5f4d1e4
ci: use | separators in cache keys for unambiguous part boundaries
anacrolix 5ece2c9
ci: use run_number instead of run_id in build cache keys
anacrolix 6ebbb4a
ci: write current timestamp to trim.txt instead of removing it
anacrolix e161826
ci: skip modcache save when content hash matches restored key
anacrolix 0003c39
ci: replace test cache step summary with warning annotation for uncac…
anacrolix 4eb18f0
ci: move modcache save into cleanup-erigon, add tag input for lint
anacrolix f8b521b
ci: centralize cache saves in cleanup-erigon, make GODEBUG overridable
anacrolix a904153
ci: add concurrency debug step to setup-erigon
anacrolix c20918c
ci: explicit submodules/lfs false in checkout, parallel submodule clone
anacrolix 8ae2383
ci: scope git restore-mtime to fixture files only
anacrolix 583c630
ci: add shallow checkout note to setup-erigon description
anacrolix 326581d
ci: move restore-build-cache into setup-erigon, use inputs instead of…
anacrolix 1c25b27
meat popsicle
anacrolix c40c332
ci: always restore build cache, add extra-key for matrix jobs
anacrolix 5a80062
ci: move extra-key after runner.arch in build cache keys
anacrolix 916daf1
ci: always include extra-key separator in build cache keys
anacrolix be448dc
meat popsicle
anacrolix 112e5b9
ci: skip redundant build cache saves on workflow re-runs
anacrolix 5006b89
meat popsicle
anacrolix c8eec02
ci: cache submodule git objects across workflow runs
anacrolix dd01f86
ci: skip Hive and Kurtosis workflows with skip-uncaching PR label
anacrolix 8c19940
meat popsicle
anacrolix f1f0cce
Merge remote-tracking branch 'origin/main' into anacrolix/all-tests-c…
anacrolix 0fdbaf0
ci: split submodule git objects cache into restore/save steps
anacrolix f016107
ci: extract test-group runner to tools/run-test-group script
anacrolix db1737b
ci: simplify run-test-group with single packages_for_group helper
anacrolix dbe734f
ci: further simplify run-test-group
anacrolix 1a7d984
Merge remote-tracking branch 'origin/main' into anacrolix/all-tests-c…
anacrolix 615f471
ci: pass SKIP_FLAKY_TESTS and GOFLAGS through env in test-group
anacrolix bc2825f
ci: fix case-in-$() syntax error on bash 3.2 (macOS)
anacrolix 68c43c7
Merge remote-tracking branch 'origin/main' into anacrolix/all-tests-c…
anacrolix 57e5a7f
ci: extend space cleanup to macOS, remove redundant inline step
anacrolix 92e4b5b
ci: merge kurtosis workflow — keep matrix, adopt container caching
anacrolix abc4155
Add the tidy check back into CI lint
anacrolix 0156b07
ci: add warning on cache miss, notice on save for gocache and submodules
anacrolix 04dfcdc
tools: remove per-group timeouts from run-test-group
anacrolix fc25fa8
tools, ci: add write-test-groups, drive race workflow matrix from it
anacrolix b2fc2fc
meat popsicle: update todo and proposal
anacrolix 662acdf
Merge remote-tracking branch 'origin/main' into anacrolix/all-tests-c…
anacrolix d148a7d
ci: fix YAML parse error in setup-erigon action
anacrolix ece7e0d
Merge branch 'main' into anacrolix/all-tests-caching
anacrolix 1dd0d3f
ci: simplify gocache key to run_id|run_attempt, pass key via env
anacrolix 95d433b
ci: remove source-of-changes job from test workflows
anacrolix e680f99
ci: fold .claude/rules back into agents.md
anacrolix 46dd222
ci: rename restore-build-cache inputs and outputs
anacrolix 372df90
ci: rework modcache to mirror build cache pattern
anacrolix 2ae021d
Merge branch 'main' into anacrolix/all-tests-caching
anacrolix cdb5d42
ci: commit tools/test-groups.json and verify it in lint
anacrolix 4d4afc6
ci: commit tools/test-groups/ and unify generated-file checks
anacrolix da42e25
meat popsicle: du is screwy on linux, update todo
anacrolix 8e69da3
Merge remote-tracking branch 'origin/main' into anacrolix/all-tests-c…
anacrolix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| use merge queues: | ||
| - fixes teh issue of rerunning tests after PR is merged | ||
| - runs tests as tho they were on the merge target, and become the new commit | ||
| - batch multiple PRs together, reducing our speed from approximately 1 commit/1-2 hours to (with other proposed fixes), N commits/30 mins | ||
| - reduces need to block PR completely in separate step | ||
| - correct place to put and block on any tests that devs can reproduce locally | ||
| - only, and can effectively, run most comprehensive tests here (like race) | ||
|
|
||
| change workflow use: | ||
| - group jobs by purpose like | ||
| - all commits | ||
| - merge queue | ||
| - QA | ||
| - ensure dispatchability, but use dispatch variables (QA has this done really well in a few places) | ||
|
|
||
| better caching: | ||
| - smarter go mod caching, reuse across jobs | ||
| - constrain build caches to use case (test, coverage, specific tests) | ||
| - set mtimes to allow test caching | ||
| - caching for fixtures is per-package, so breaking up big packages for different fixtures fixes this | ||
|
|
||
| timeouts: | ||
| - aim for individual job limits of 30 minutes (cold). real target is 10 mins average. this is not to catch overuse of runners, but to ensure tests evolve to be parallelizable as we go (PRs that make them bigger should improve the workflow to accomodate if required). | ||
|
||
| - on merge queue, set timeouts higher (60 mins) | ||
|
|
||
| regressions: | ||
| - no workflows should invalidate past success. for example lint should not run on main, it should block on PR. it probably shouldn't run in merge queue. | ||
| - regressions should be detected asynchronously on schedules (QA do this for example). | ||
|
|
||
| local reproducibility: | ||
| - all jobs should have a way to locally reproduce for testing, and dev prechecks (i'm changing X code, so i should do X tests first). | ||
| - tests that can be reproduced locally should preferably only occur in the merge group checks. | ||
| - all workflows should have local invocation equivalents. | ||
|
|
||
| flaky tests: | ||
| - these should be aggressively trimmed. unrelated failures in PRs should be reported, and skipped rather than waiting. | ||
| - scheduled race and non-race workflows for discovering flaky tests by repeating tests | ||
| - ideal place for bots to discover, and fix | ||
|
|
||
| next steps: | ||
| - 3-5x our runner counts | ||
| - enable merge queue, perhaps on a test branch (merge-queue-experiment/main) | ||
|
|
||
| look for flaky tests in scheduled runs that repeat tests constantly | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| # CI Notes | ||
|
|
||
| ## Required jobs | ||
|
|
||
| This can block on workflows or jobs that won't run because they haven't been appropriately triggered. This is a tricky spot. I think merge queues would fix this by providing a final gate where everything should run. | ||
|
|
||
| Required checks are opt-in, configured in repo settings under branch protection rules. By default no checks are required and PRs can merge regardless of workflow status. | ||
|
|
||
| If a workflow is skipped entirely (e.g. due to path filters), no check is reported for that commit SHA, and a required status check stays pending indefinitely, blocking the PR. To avoid this, don't use workflow-level `paths`/`paths-ignore` on workflows with required checks. Instead, use a paths-filter step inside the job (e.g. `dorny/paths-filter`) so the job always runs and reports a status, but skips the expensive steps when no relevant paths changed. | ||
|
|
||
| ## Merge queues | ||
|
|
||
| Merge queues still rely on required checks. You select which checks the queue runs in branch protection settings. There's no "everything must pass" mode. | ||
|
|
||
| The queue creates a temporary branch with the PR merged on top of the latest base branch, runs checks against that speculative merge commit, and if they pass, fast-forwards the target branch to it. This prevents the "PR was green but broke after merge" problem. | ||
|
|
||
| Merge queues batch multiple PRs. When a batch fails, GitHub bisects: it splits the batch in half and retries each subset, continuing until it identifies which PR(s) caused the failure. The failing PR is ejected from the queue and the remaining PRs are re-batched and retested. Larger batches are more efficient when everything passes, but a single failure triggers multiple bisection rounds. | ||
|
|
||
| ### Running tests only in the merge queue | ||
|
|
||
| The `merge_group` event triggers when a PR is added to the merge queue and GitHub creates the speculative merge commit: | ||
|
|
||
| ```yaml | ||
| on: | ||
| merge_group: | ||
| ``` | ||
| Remove `pull_request` and `push` from a workflow's `on:` triggers to run it exclusively in the queue. The tradeoff is that developers get no feedback until the PR enters the merge queue. A practical middle ground: run fast checks (lint, build) on `pull_request` for quick feedback, and defer expensive tests (full test suite, integration, hive) to `merge_group` only. | ||
|
|
||
| ## Triggering events | ||
|
|
||
| Tests that can be run locally should run as late in the pull request phase as possible. So for example the all tests currently can run exclusively on auto-merge enabled. And any other event that indicates that it could be merged imminently. | ||
|
|
||
| ### `pull_request` event types | ||
|
|
||
| If `types:` is omitted, the defaults are `opened`, `synchronize`, and `reopened`. Most CI workflows add `ready_for_review` so that draft PRs don't run CI until they're marked ready. The full list: | ||
|
|
||
| - `opened` — PR created | ||
| - `reopened` — closed PR reopened | ||
| - `synchronize` — new commit pushed to head branch (or force-push) | ||
| - `closed` — PR closed (merged or not; check `github.event.pull_request.merged`) | ||
| - `edited` — title, body, or base branch changed | ||
| - `ready_for_review` — PR moved from draft to non-draft | ||
| - `converted_to_draft` — PR moved from non-draft to draft | ||
| - `assigned` / `unassigned` — assignee added/removed | ||
| - `labeled` / `unlabeled` — label added/removed | ||
| - `locked` / `unlocked` — conversation locked/unlocked | ||
| - `review_requested` / `review_request_removed` — reviewer requested/removed | ||
| - `auto_merge_enabled` / `auto_merge_disabled` | ||
| - `milestoned` / `demilestoned` | ||
| - `enqueued` / `dequeued` — added to/removed from merge queue | ||
|
|
||
| ### Path filters | ||
|
|
||
| For `pull_request` events, `paths`/`paths-ignore` compare the entire PR diff against the base branch, not just the latest commit. If any commit in the PR touches a matching path, the workflow triggers on every `synchronize` event, even if the new commit only changes unrelated files. | ||
|
|
||
| For `push` events, path filters compare against the previous commit on that branch (the before/after of that specific push), so filtering is more granular per-push. | ||
|
|
||
| ### `push` vs `pull_request` | ||
|
|
||
| `push`-triggered runs satisfy required status checks on PRs. GitHub matches checks by commit SHA + check name, not by event type. The `push` event creates a check on the same SHA that is the PR's head commit. | ||
|
|
||
| `push` fires on every push to every matching branch regardless of whether a PR exists. `pull_request` only fires when there's an associated PR, making it the right trigger for "only run on branches with open PRs." | ||
|
|
||
| `github.ref` differs by event: `push` gives `refs/heads/<branch>`, `pull_request` gives `refs/pull/<number>/merge`. This matters for concurrency groups that use `github.event.pull_request.number` — that field is empty under `push` events. | ||
|
|
||
| ## Go module caching | ||
|
|
||
| `$(go env GOMODCACHE)/cache/download` contains only the downloaded zip archives and metadata. Caching this instead of the full GOMODCACHE avoids storing the extracted source trees, roughly halving cache size. `go mod download` is self-healing: it checks what's already present and fills in any missing zips, so incomplete restores recover automatically. | ||
|
|
||
| ## Cache key formats | ||
|
|
||
| ### Go module cache (`setup-go` action) | ||
|
|
||
| | | Key | | ||
| |-|-----| | ||
| | Restore | `gomodcache-{os}-{hash(go.sum)}` | | ||
| | Restore fallback | `gomodcache-{os}-` | | ||
| | Save | `gomodcache-{os}-{hash(go.sum)}-{mod-contents-hash}` | | ||
|
|
||
| The save key appends a hash of the installed module directories so that cache entries are deduplicated when `go.sum` changes but the resolved set of modules doesn't. | ||
|
|
||
| ### Go build cache (`restore-build-cache` / `save-build-cache` actions) | ||
|
|
||
| | | Key | | ||
| |-|-----| | ||
| | Save | `gocache-{workflow_file}-{job}-{goversion}-{os}-{arch}-{branch}-{sha}-{run_id}` | | ||
| | Restore (exact) | `gocache-{workflow_file}-{job}-{goversion}-{os}-{arch}-{branch}-{sha}-{run_id}` | | ||
| | Restore fallback 1 | `gocache-{workflow_file}-{job}-{goversion}-{os}-{arch}-{branch}-{sha}-` | | ||
| | Restore fallback 2 | `gocache-{workflow_file}-{job}-{goversion}-{os}-{arch}-{branch}-{parent}-` | | ||
| | Restore fallback 3 | `gocache-{workflow_file}-{job}-{goversion}-{os}-{arch}-{branch}-` | | ||
| | Restore fallback 4 | `gocache-{workflow_file}-{job}-{goversion}-{os}-{arch}-{base_ref}-{parent}-` | | ||
| | Restore fallback 5 | `gocache-{workflow_file}-{job}-{goversion}-{os}-{arch}-{base_ref}-` | | ||
|
|
||
| Each workflow+job combination gets its own cache namespace automatically via the workflow filename (e.g. `test-all-erigon`) and `github.job`. Branch-aware keys let PR caches restore from the base branch when no PR-specific cache exists. | ||
|
|
||
| The build cache contains a `testexpire.txt` file that controls test cache staleness. It holds a Unix timestamp in nanoseconds; cached test results from before that time are re-run. It's only updated by `go clean -testcache`. Separately, `trim.txt` controls disk eviction of old cache entries (both build and test) that haven't been accessed recently. | ||
|
|
||
| ### golangci-lint cache (`lint` workflow) | ||
|
|
||
| | | Key | | ||
| |-|-----| | ||
| | Restore | `golangci-lint-{os}-{hash(go.mod)}` | | ||
| | Restore fallback | `golangci-lint-{os}-` | | ||
| | Save | same as restore exact key | | ||
|
|
||
| ## TODO | ||
|
|
||
| - Most workflows should run on pull request to any branch. | ||
| - Tighten timeouts where possible. | ||
|
|
||
| ## Debugging workflows | ||
|
|
||
| Re-run a failed run with debug logging enabled: | ||
|
|
||
| ```bash | ||
| gh run rerun <run-id> --debug | ||
| ``` | ||
|
|
||
| Or in the UI, use the "Re-run jobs" dropdown and check "Enable debug logging." | ||
|
|
||
| This can also be enabled persistently by setting the repo secret/variable `ACTIONS_STEP_DEBUG` to `true` (verbose step output) or `ACTIONS_RUNNER_DEBUG` to `true` (runner diagnostic logs). | ||
|
|
||
| Raw logs (`gh run view <run-id> --log`) contain timestamps on every line, which can be used to measure how long individual operations take within a step (e.g. per-submodule checkout times). | ||
|
|
||
| ## Notes that could be claude rules too | ||
|
|
||
| * Tests that can be reproduced locally, should always fail-fast and terminate the rest to not waste runner time. | ||
|
|
||
| https://github.com/erigontech/erigon/actions/metrics/performance?tab=jobs&filters=-runner_type%3Aself-hosted | ||
|
|
||
| GODEBUG with gocachehash, gocachetest, gocacheverify |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| name: Cleanup Erigon | ||
| description: Save build and module caches, and warn about uncached tests | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - uses: ./.github/actions/save-build-cache | ||
| if: ${{ always() && env.ERIGON_CI_GOCACHE_PATH != '' }} | ||
| with: | ||
| gocache: ${{ env.ERIGON_CI_GOCACHE_PATH }} | ||
| key: ${{ env.ERIGON_CI_GOCACHE_KEY }} | ||
|
|
||
| - uses: ./.github/actions/save-mod-cache | ||
| if: ${{ always() && env.ERIGON_CI_MODCACHE != '' }} | ||
| with: | ||
| modcache-path: ${{ env.ERIGON_CI_MODCACHE }} | ||
| key: ${{ env.ERIGON_CI_MODCACHE_KEY }} | ||
|
|
||
| - name: Save submodule git objects cache | ||
| if: >- | ||
| ${{ always() | ||
| && env.ERIGON_CI_SUBMODULE_CACHE_KEY != '' | ||
| && env.ERIGON_CI_SUBMODULE_CACHE_RESTORED_KEY != env.ERIGON_CI_SUBMODULE_CACHE_KEY }} | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: .git/modules | ||
| key: ${{ env.ERIGON_CI_SUBMODULE_CACHE_KEY }} | ||
|
|
||
| - name: Check for uncached tests | ||
| if: hashFiles('run.log') != '' | ||
| shell: bash | ||
| run: | | ||
| ran=$(grep -cE '^ok\s.*[0-9]+\.[0-9]+s$' run.log || true) | ||
| if [ "$ran" -gt 0 ]; then | ||
| echo "::warning::$ran test package(s) ran without caching" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: Restore Go build cache | ||
| description: Restore Go build cache keyed by workflow, job, and run | ||
|
|
||
| inputs: | ||
| gocache-path: | ||
| description: "GOCACHE path" | ||
| required: true | ||
| goversion: | ||
| description: "Full Go version string (e.g. go1.25.7)" | ||
| required: true | ||
| workflow-id: | ||
| description: "Workflow name for cache key namespacing" | ||
| required: true | ||
| matrix-key: | ||
| description: "Extra segment appended after runner.arch in the cache key (e.g. matrix value)" | ||
| required: false | ||
| default: '' | ||
|
|
||
| outputs: | ||
| restored-key: | ||
| description: "The cache key that was restored (empty if miss)" | ||
| value: ${{ steps.restore.outputs.cache-matched-key }} | ||
| primary-key: | ||
| description: "The primary cache key (for use by save-build-cache)" | ||
| value: gocache|${{ inputs.workflow-id }}|${{ github.job }}|${{ inputs.matrix-key }}|${{ inputs.goversion }}|${{ runner.os }}|${{ runner.arch }}|${{ github.run_id }}|${{ github.run_attempt }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - id: restore | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: ${{ inputs.gocache-path }} | ||
| key: gocache|${{ inputs.workflow-id }}|${{ github.job }}|${{ inputs.matrix-key }}|${{ inputs.goversion }}|${{ runner.os }}|${{ runner.arch }}|${{ github.run_id }}|${{ github.run_attempt }} | ||
| restore-keys: | | ||
| gocache|${{ inputs.workflow-id }}|${{ github.job }}|${{ inputs.matrix-key }}|${{ inputs.goversion }}|${{ runner.os }}|${{ runner.arch }}|${{ github.run_id }}| | ||
| gocache|${{ inputs.workflow-id }}|${{ github.job }}|${{ inputs.matrix-key }}|${{ inputs.goversion }}|${{ runner.os }}|${{ runner.arch }}| | ||
|
|
||
| - name: Warn on build cache miss | ||
| if: ${{ steps.restore.outputs.cache-matched-key == '' }} | ||
| shell: bash | ||
| run: echo "::warning::Go build cache miss — no matching key found" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: Restore Go module cache | ||
| description: Restore Go module cache keyed by workflow, job, and run | ||
|
|
||
| inputs: | ||
| modcache-path: | ||
| description: "GOMODCACHE path" | ||
| required: true | ||
| workflow-id: | ||
| description: "Workflow name for cache key namespacing" | ||
| required: true | ||
| matrix-key: | ||
| description: "Extra segment in the cache key (e.g. matrix value)" | ||
| required: false | ||
| default: '' | ||
|
|
||
| outputs: | ||
| restored-key: | ||
| description: "The cache key that was restored (empty if miss)" | ||
| value: ${{ steps.restore.outputs.cache-matched-key }} | ||
| primary-key: | ||
| description: "The primary cache key (for use by save-mod-cache)" | ||
| value: gomodcache|${{ inputs.workflow-id }}|${{ github.job }}|${{ inputs.matrix-key }}|${{ runner.os }}|${{ hashFiles('go.sum') }}|${{ github.run_id }}|${{ github.run_attempt }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - id: restore | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: ${{ inputs.modcache-path }}/cache/download | ||
| key: gomodcache|${{ inputs.workflow-id }}|${{ github.job }}|${{ inputs.matrix-key }}|${{ runner.os }}|${{ hashFiles('go.sum') }}|${{ github.run_id }}|${{ github.run_attempt }} | ||
| restore-keys: | | ||
| gomodcache|${{ inputs.workflow-id }}|${{ github.job }}|${{ inputs.matrix-key }}|${{ runner.os }}|${{ hashFiles('go.sum') }}|${{ github.run_id }}| | ||
| gomodcache|${{ inputs.workflow-id }}|${{ github.job }}|${{ inputs.matrix-key }}|${{ runner.os }}|${{ hashFiles('go.sum') }}| | ||
| gomodcache|${{ inputs.workflow-id }}|${{ github.job }}|${{ inputs.matrix-key }}|${{ runner.os }}| | ||
|
|
||
| - name: Warn on module cache miss | ||
| if: ${{ steps.restore.outputs.cache-matched-key == '' }} | ||
| shell: bash | ||
| run: echo "::warning::Go module cache miss — no matching key found" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| name: Save Go build cache | ||
| description: Save Go build cache using the provided key | ||
|
|
||
| inputs: | ||
| gocache: | ||
| description: "GOCACHE path" | ||
| required: true | ||
| key: | ||
| description: "Cache key to save under (from restore-build-cache outputs.primary-key)" | ||
| required: true | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Show build cache size | ||
| if: ${{ always() }} | ||
| shell: bash | ||
| run: du -hs "${{ inputs.gocache }}" || true | ||
|
|
||
| - name: Clean fuzz cache | ||
| if: ${{ always() }} | ||
| shell: bash | ||
| run: go clean -fuzzcache | ||
|
|
||
| - uses: actions/cache/save@v4 | ||
| if: ${{ always() }} | ||
| with: | ||
| path: ${{ inputs.gocache }} | ||
| key: ${{ inputs.key }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| name: Save Go module cache | ||
| description: Save Go module download cache using the provided key | ||
|
|
||
| inputs: | ||
| modcache-path: | ||
| description: "GOMODCACHE path" | ||
| required: true | ||
| key: | ||
| description: "Cache key to save under (from restore-mod-cache outputs.primary-key)" | ||
| required: true | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Show module cache size | ||
| if: ${{ always() }} | ||
| shell: bash | ||
| run: | | ||
| time du -hs "${{ inputs.modcache-path }}" || true | ||
| time du -hs "${{ inputs.modcache-path }}/cache/download" || true | ||
|
|
||
| - uses: actions/cache/save@v4 | ||
| if: ${{ always() }} | ||
| with: | ||
| path: ${{ inputs.modcache-path }}/cache/download | ||
| key: ${{ inputs.key }} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doc has a few typos ('teh', 'tho', 'accomodate') that reduce readability/searchability. Please correct them.