Run push.yml periodically with clean cache#2092
Merged
Merged
Conversation
This ensures that our build still works with clean cache and also populates build/test cache, speeding up test runs.
pietern
reviewed
Jan 7, 2025
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Clean up cache if running on schedule | ||
| if: ${{ github.event_name == 'schedule' }} |
Contributor
There was a problem hiding this comment.
You can move this to the job level.
Contributor
Author
There was a problem hiding this comment.
I was not sure if that's going to work given the dependency on it. But if you say yes - let's move it.
Contributor
Author
There was a problem hiding this comment.
IT does not work, it skipped all the dependent jobs.
…eco-testing-runner-group"
pietern
approved these changes
Jan 7, 2025
This reverts commit dc1f1c1.
This reverts commit 1d98c62.
Contributor
Author
|
Here's a build with fresh cache: https://github.com/databricks/cli/actions/runs/12655847882/job/35267108740 tests on ubuntu took 20s and on mac 30s. |
denik
added a commit
that referenced
this pull request
May 20, 2026
This ensures that our build still works with clean cache and also populates build/test cache, speeding up test runs.
pietern
added a commit
that referenced
this pull request
May 27, 2026
## Why `push.yml` saves many setup-go caches per run, but PR / merge_group / schedule saves are scoped to refs no other run can read. They still count against the 10 GB per-repo quota and evict main's caches via LRU, so most PRs miss the cache entirely. See the [GitHub Actions dependency-caching docs](https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching) for the scope and eviction rules. ## What ### `setup-build-environment` composite The composite now manages the Go cache explicitly instead of relying on `setup-go`'s built-in caching. `setup-go` runs with `cache: false`. On `refs/heads/main` (push + the scheduled wipe-and-repopulate cron from #2092) the unified `actions/cache@v5.0.5` restores immediately and its post-step saves at the calling job's end — composite-action post-steps fire at the job's end, not the composite's, so this works inside the composite. On every other ref, `actions/cache/restore@v5.0.5` restores only. `restore-keys` provides prefix fallback so PR runs with a changed `go.sum` still restore main's most recent cache and rebuild only the delta. The `cache.txt` workaround is gone — `inputs.cache-key` goes directly into the cache key string. ### Drop `task cover` from CI `task cover` was a smoke check on main pushes. Cover-instrumented test binaries land in a different `GOCACHE` slot than the non-cover binaries PRs need, so a `go.sum` bump landing on a main push would leave the cache holding cover artifacts until the next 00:00 UTC wipe-and-repopulate fixed it (up to 24h of PRs missing the test-binary slot). Running `task test` on every event eliminates that hole; coverage stays in `Taskfile.yml` for local use and can come back to CI when there's a real consumer. ### Scheduled cache wipe: twice daily → once daily The cron from #2092 wiped the cache at 00:00 and 12:00 UTC. The noon wipe was harmless when every PR repopulated; now that only main runs repopulate, it creates an unnecessary cold-cache window during the workday. Trimmed to 00:00 UTC. ## Potential follow-ups - `check.yml` lint cache - Three standalone `setup-go` invocations in `push.yml` (`testmask`, `validate-generated-is-up-to-date`, `validate-python-codegen`) - `~/.cache/golangci-lint` analyzer cache This pull request and its description were written by Isaac.
denik
pushed a commit
that referenced
this pull request
May 28, 2026
## Why `push.yml` saves many setup-go caches per run, but PR / merge_group / schedule saves are scoped to refs no other run can read. They still count against the 10 GB per-repo quota and evict main's caches via LRU, so most PRs miss the cache entirely. See the [GitHub Actions dependency-caching docs](https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching) for the scope and eviction rules. ## What ### `setup-build-environment` composite The composite now manages the Go cache explicitly instead of relying on `setup-go`'s built-in caching. `setup-go` runs with `cache: false`. On `refs/heads/main` (push + the scheduled wipe-and-repopulate cron from #2092) the unified `actions/cache@v5.0.5` restores immediately and its post-step saves at the calling job's end — composite-action post-steps fire at the job's end, not the composite's, so this works inside the composite. On every other ref, `actions/cache/restore@v5.0.5` restores only. `restore-keys` provides prefix fallback so PR runs with a changed `go.sum` still restore main's most recent cache and rebuild only the delta. The `cache.txt` workaround is gone — `inputs.cache-key` goes directly into the cache key string. ### Drop `task cover` from CI `task cover` was a smoke check on main pushes. Cover-instrumented test binaries land in a different `GOCACHE` slot than the non-cover binaries PRs need, so a `go.sum` bump landing on a main push would leave the cache holding cover artifacts until the next 00:00 UTC wipe-and-repopulate fixed it (up to 24h of PRs missing the test-binary slot). Running `task test` on every event eliminates that hole; coverage stays in `Taskfile.yml` for local use and can come back to CI when there's a real consumer. ### Scheduled cache wipe: twice daily → once daily The cron from #2092 wiped the cache at 00:00 and 12:00 UTC. The noon wipe was harmless when every PR repopulated; now that only main runs repopulate, it creates an unnecessary cold-cache window during the workday. Trimmed to 00:00 UTC. ## Potential follow-ups - `check.yml` lint cache - Three standalone `setup-go` invocations in `push.yml` (`testmask`, `validate-generated-is-up-to-date`, `validate-python-codegen`) - `~/.cache/golangci-lint` analyzer cache This pull request and its description were written by Isaac.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This ensures that our build still works with clean cache and also populates build/test cache, speeding up test runs.