Repository navigation
CI: keep finished native builds in a release, so they're never built again for the same inputs - #34
Merged
Merged
Conversation
…again for the same inputs ext/native-store.sh keeps each platform's finished SDL and SDL_shadercross build as a .tar.gz asset of one release, native-builds, named after a hash of its inputs. Release assets don't expire after 7 days unused like Actions caches, and every branch can read them, so macOS runners are only needed when an input changes. sdl-native.yml and shadercross-native.yml look in the store first, then the Actions cache, then build. Runs on the default branch put builds into the store, including ones found only in a cache; pull requests only read it. SDL now builds and caches each platform on its own, like SDL_shadercross, and reads its old combined cache once to fill the store without building again.
lithiumtoast
added a commit
that referenced
this pull request
Dec 1, 2026
CI's `main` runs took about 8 minutes, set by the Windows build at about 7. Most of that repeated tests whose result doesn't depend on the operating system. **What runs where** | | Linux | Windows, macOS | | --- | --- | --- | | Console, web API and game consumers (NativeAOT, platform packaging, SDL loading) | yes | yes | | WebAssembly web app publish | yes | no, same output everywhere | | Templates: create, build, publish and run the template's game | yes | no, same output everywhere; the game consumers cover packaging | | Assetyard's test, with the OS's own SDL_shadercross | yes | yes, new: the packaged tool used to run only on Linux | | `cs-game-publish.yml` on the game consumer | yes | no; `test.sh` already publishes it on each OS | - **`test.sh`** gets `TEST_SCOPE`: `all`, the default and what local runs get, or `platform`, which Windows and macOS use in CI. - **Assetyard's test** now works on Windows: its `nuget.config` gets native paths (`pwd -W`), and its error check doesn't depend on the path's slashes. - **`main.yml`'s build script** is now a multi-line block, one command per line, with comments. **No CI for docs-only pull requests:** `paths-ignore` for `**/*.md` and `docs/**`, on pull requests only. Pushes to `main` always run CI, because a release needs `main`'s run to have passed for its commit. **Also** - SDL's combined-cache code is gone. The store (#34) has all six SDL builds for the current SDL commit. - The shorter native job names from #34 are back. That commit was left out when #34 was squash-merged, because GitHub never synced the PR with its last push. - A shellcheck warning in `test.sh` (a glob used as a command name) is fixed. **Not done:** one job per library for stored builds instead of one per platform. A workflow can't loop over `upload-artifact` or `cache/restore`, so it would take about a dozen repeated steps per workflow, to save jobs that already run in parallel in 10–20 seconds each. **Expected:** Windows build about 7 → 4 minutes, macOS about 4.5 → 2.5, a `main` run about 8 → 5. `main` runs also have one macOS job fewer. **Checked locally on macOS:** `TEST_SCOPE=platform` runs the three consumers and skips the rest, `TEST_SCOPE=all` behaves as before, and Assetyard's test passes. All workflows pass `actionlint`. --------- Co-authored-by: Lucas Girouard-Stranks <lithiumtoast@users.noreply.github.com>
lithiumtoast
added a commit
that referenced
this pull request
Dec 1, 2026
`v2026.12.1-rc`'s notes compared `native-builds...v2026.12.1-rc` and listed only #35. GitHub's generated notes start from the newest release of any tag, and the `native-builds` pre-release (#34) is a release too. (I've already edited that release's notes to compare against `v2026.11.30-rc.3`; they now list #27 through #35.) **The fix, in the `cs-release` action:** a new "Release notes" step finds the newest non-draft release whose tag starts with `v`, asks GitHub's `generate-notes` API for the notes since then, and passes them to the release with `body_path` instead of `generate_release_notes`. Other repositories using the action get the same behaviour, so releases with other tags never break their notes. With no earlier `v` release, GitHub's default is used. **Checked:** the step's query, run against this repository, picks `v2026.12.1-rc` as the previous release. `generate-notes` only returns text; it creates nothing. `actionlint` passes, and `docs/workflows.md` says where the notes start. The step only runs when the action pushes, so this PR's CI release dry run skips it. The next release is its first real run. Co-authored-by: Lucas Girouard-Stranks <lithiumtoast@users.noreply.github.com>
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.
Actions caches are deleted after 7 days unused, and a branch can only read its own and the default branch's. So a quiet week, or any change to a cache's key, means building SDL_shadercross again: about 40 minutes on a scarce macOS runner. This keeps every finished native build where it doesn't expire.
The store
ext/native-store.shkeeps each platform's finished build of SDL or SDL_shadercross as a.tar.gzasset of one pre-release,native-builds, named after a hash of its inputs: for exampleshadercross-native-osx-<hash>.tar.gz..tar.gzalso keeps the tool's executable permission.The workflows
sdl-native.ymlandshadercross-native.ymllook for each platform in the store first, then in an Actions cache, and only then build it.sdl-native-all-...) once more, so the store gets SDL without building it again. That part can go once the store has this SDL commit.main.ymlgives both native workflowscontents: write, for the store, andactions: read, to list caches.Checked
ext/native-store.sh:asset-name,hasagainst the real repository (no release yet) and an unknown command.uploadanddownloadfirst run onmain, since pull requests don't write.main's new caches, saved bymain's run after bottlenoselabs.SDL.ShaderCross.Native: the SDL_shadercross library for apps #32, which finished before this PR was opened.actionlint.After merging:
main's next run uploads all eleven builds (6 SDL, 5 SDL_shadercross) from the caches into the store. After that, a build only happens when its inputs change.To watch at the next release: whether GitHub's automatic release notes compare against the
native-buildspre-release instead of the previous version.