Skip to content
Open
Show file tree
Hide file tree
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 Feb 20, 2026
a099a0d
Remove unnecessary action name overrides
anacrolix Feb 21, 2026
f1a3bf1
ci: refactor kurtosis-assertoor workflow to use matrix strategy
anacrolix Feb 21, 2026
66e11db
ci: consolidate checkout into setup-erigon, restore file mtimes from …
anacrolix Feb 21, 2026
33786f6
ci: use git parent commit for cache restore, simplify save key
anacrolix Feb 22, 2026
4010dea
Meat popsicle cleanup
anacrolix Feb 22, 2026
0612ca6
ci: use workflow filename instead of name in cache keys
anacrolix Feb 22, 2026
d9fa772
ci: add test cache statistics to job summaries
anacrolix Feb 23, 2026
85ba89e
ci: continue on errors in test-caching rerun script
anacrolix Feb 23, 2026
7ca0e06
meat popsicle
anacrolix Feb 23, 2026
509aabd
meat popsicle
anacrolix Feb 23, 2026
eb90044
ci: fix git curl verbose output in non-debug CI runs
anacrolix Feb 23, 2026
24b9ca8
meat popsicle
anacrolix Feb 23, 2026
1a508ed
execution/tests: split 4 slowest EEST blockchain subtests into separa…
anacrolix Feb 23, 2026
55c263b
ci: split slow EEST blockchain tests into separate race-test matrix jobs
anacrolix Feb 23, 2026
5f4d1e4
ci: use | separators in cache keys for unambiguous part boundaries
anacrolix Feb 23, 2026
5ece2c9
ci: use run_number instead of run_id in build cache keys
anacrolix Feb 23, 2026
6ebbb4a
ci: write current timestamp to trim.txt instead of removing it
anacrolix Feb 24, 2026
e161826
ci: skip modcache save when content hash matches restored key
anacrolix Feb 24, 2026
0003c39
ci: replace test cache step summary with warning annotation for uncac…
anacrolix Feb 24, 2026
4eb18f0
ci: move modcache save into cleanup-erigon, add tag input for lint
anacrolix Feb 24, 2026
f8b521b
ci: centralize cache saves in cleanup-erigon, make GODEBUG overridable
anacrolix Feb 24, 2026
a904153
ci: add concurrency debug step to setup-erigon
anacrolix Feb 24, 2026
c20918c
ci: explicit submodules/lfs false in checkout, parallel submodule clone
anacrolix Feb 24, 2026
8ae2383
ci: scope git restore-mtime to fixture files only
anacrolix Feb 24, 2026
583c630
ci: add shallow checkout note to setup-erigon description
anacrolix Feb 24, 2026
326581d
ci: move restore-build-cache into setup-erigon, use inputs instead of…
anacrolix Feb 24, 2026
1c25b27
meat popsicle
anacrolix Feb 24, 2026
c40c332
ci: always restore build cache, add extra-key for matrix jobs
anacrolix Feb 24, 2026
5a80062
ci: move extra-key after runner.arch in build cache keys
anacrolix Feb 24, 2026
916daf1
ci: always include extra-key separator in build cache keys
anacrolix Feb 24, 2026
be448dc
meat popsicle
anacrolix Feb 24, 2026
112e5b9
ci: skip redundant build cache saves on workflow re-runs
anacrolix Feb 24, 2026
5006b89
meat popsicle
anacrolix Feb 24, 2026
c8eec02
ci: cache submodule git objects across workflow runs
anacrolix Feb 24, 2026
dd01f86
ci: skip Hive and Kurtosis workflows with skip-uncaching PR label
anacrolix Feb 25, 2026
8c19940
meat popsicle
anacrolix Feb 25, 2026
f1f0cce
Merge remote-tracking branch 'origin/main' into anacrolix/all-tests-c…
anacrolix Feb 25, 2026
0fdbaf0
ci: split submodule git objects cache into restore/save steps
anacrolix Feb 25, 2026
f016107
ci: extract test-group runner to tools/run-test-group script
anacrolix Feb 25, 2026
db1737b
ci: simplify run-test-group with single packages_for_group helper
anacrolix Feb 25, 2026
dbe734f
ci: further simplify run-test-group
anacrolix Feb 25, 2026
1a7d984
Merge remote-tracking branch 'origin/main' into anacrolix/all-tests-c…
anacrolix Feb 25, 2026
615f471
ci: pass SKIP_FLAKY_TESTS and GOFLAGS through env in test-group
anacrolix Feb 25, 2026
bc2825f
ci: fix case-in-$() syntax error on bash 3.2 (macOS)
anacrolix Feb 25, 2026
68c43c7
Merge remote-tracking branch 'origin/main' into anacrolix/all-tests-c…
anacrolix Feb 26, 2026
57e5a7f
ci: extend space cleanup to macOS, remove redundant inline step
anacrolix Feb 26, 2026
92e4b5b
ci: merge kurtosis workflow — keep matrix, adopt container caching
anacrolix Feb 26, 2026
abc4155
Add the tidy check back into CI lint
anacrolix Feb 26, 2026
0156b07
ci: add warning on cache miss, notice on save for gocache and submodules
anacrolix Feb 26, 2026
04dfcdc
tools: remove per-group timeouts from run-test-group
anacrolix Feb 26, 2026
fc25fa8
tools, ci: add write-test-groups, drive race workflow matrix from it
anacrolix Feb 26, 2026
b2fc2fc
meat popsicle: update todo and proposal
anacrolix Feb 26, 2026
662acdf
Merge remote-tracking branch 'origin/main' into anacrolix/all-tests-c…
anacrolix Feb 26, 2026
d148a7d
ci: fix YAML parse error in setup-erigon action
anacrolix Feb 26, 2026
ece7e0d
Merge branch 'main' into anacrolix/all-tests-caching
anacrolix Feb 26, 2026
1dd0d3f
ci: simplify gocache key to run_id|run_attempt, pass key via env
anacrolix Feb 27, 2026
95d433b
ci: remove source-of-changes job from test workflows
anacrolix Feb 27, 2026
e680f99
ci: fold .claude/rules back into agents.md
anacrolix Feb 27, 2026
46dd222
ci: rename restore-build-cache inputs and outputs
anacrolix Feb 27, 2026
372df90
ci: rework modcache to mirror build cache pattern
anacrolix Feb 27, 2026
2ae021d
Merge branch 'main' into anacrolix/all-tests-caching
anacrolix Feb 27, 2026
cdb5d42
ci: commit tools/test-groups.json and verify it in lint
anacrolix Feb 27, 2026
4d4afc6
ci: commit tools/test-groups/ and unify generated-file checks
anacrolix Feb 27, 2026
da42e25
meat popsicle: du is screwy on linux, update todo
anacrolix Feb 27, 2026
8e69da3
Merge remote-tracking branch 'origin/main' into anacrolix/all-tests-c…
anacrolix Mar 3, 2026
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
11 changes: 10 additions & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@
"Bash(go vet:*)",
"Bash(make lint:*)",
"Bash(git fetch:*)",
"Bash(go mod tidy:*)"
"Bash(go mod tidy:*)",
"WebFetch(domain:github.com)",
"WebSearch",
"WebFetch(domain:raw.githubusercontent.com)",
"Bash(git status:*)",
"Bash(gh pr edit:*)",
"Bash(git lfs ls-files:*)",
"Bash(grep:*)",
"Bash(git add:*)",
"WebFetch(domain:pypi.org)"
]
}
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Auto detect text files and perform LF normalization
* text=auto
*.txt text eol=lf
# Force LF so hashFiles('go.sum') produces consistent CI cache keys across OSes
go.sum text eol=lf
*.sol linguist-language=Solidity
execution/tests/test-corners/invalid-receipt-hash-high-mgas/pre_alloc/0xf98dafc65f9849f5e7b63ca108d8237b5228e828.json filter=lfs diff=lfs merge=lfs -text

Expand Down
44 changes: 44 additions & 0 deletions .github/PROPOSAL.md
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
Comment on lines +2 to +3
Copy link

Copilot AI Feb 26, 2026

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.

Copilot uses AI. Check for mistakes.
- 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).
Copy link

Copilot AI Feb 26, 2026

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.

Copilot uses AI. Check for mistakes.
- 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
132 changes: 132 additions & 0 deletions .github/README.md
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
36 changes: 36 additions & 0 deletions .github/actions/cleanup-erigon/action.yml
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
42 changes: 42 additions & 0 deletions .github/actions/restore-build-cache/action.yml
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"
40 changes: 40 additions & 0 deletions .github/actions/restore-mod-cache/action.yml
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"
29 changes: 29 additions & 0 deletions .github/actions/save-build-cache/action.yml
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 }}
26 changes: 26 additions & 0 deletions .github/actions/save-mod-cache/action.yml
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 }}
Loading
Loading