Repository navigation
ci: run the shared guards on the runner python3 instead of downloading CPython - #3
Merged
Merged
Conversation
…ing CPython The self-hosted-runners action and the content-checks, ftl-daily-budget and game-standard workflows called actions/setup-python, which downloads and installs CPython 3.12 on every run and can time out a 5-minute job. They now use the runner's python3. The self-hosted-runners action installs PyYAML with pip --target only when the runner lacks it.
There was a problem hiding this comment.
Looks good. The shared runner guard and the three workflows now use the runner's own python3 instead of downloading CPython on every run. PyYAML is installed into a temporary target only when the runner lacks it, and a runner without python3 fails with a clear error. Callers pin the action by commit, so nothing changes for them until they update the pin. CI is green.
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.
What
The shared
self-hosted-runnersaction no longer callsactions/setup-python. It runs the runner's ownpython3; if PyYAML is missing it installspyyaml==6.0.2withpip install --targetinto$RUNNER_TEMPand adds that directory toPYTHONPATH(the pattern the Android build workflows already use). It fails with a clear error if the runner has nopython3.The same
setup-pythonstep is removed from this repository's owncontent-checks,ftl-daily-budget-actionandgame-standard-actionworkflows. Theftl-daily-budgetandgame-standardactions already pick the first suitable interpreter on the runner, so they need no change.content-checksinstalls PyYAML for its guard tests with the same--targetfallback.Why
actions/setup-pythondownloads and installs CPython 3.12 on every run of a self-hosted runner. In a calling repository theself-hosted-runnersjob hastimeout-minutes: 5and was cancelled at the limit right after "Successfully set up CPython". Every code check had passed; only the guard job timed out, and the aggregate check failed on it.How tested
actionlintoncontent-checks.yml,ftl-daily-budget-action.ymlandgame-standard-action.yml: clean. (Other workflows in the repo report existing shellcheck info notes; not touched.)python3 .github/actions/self-hosted-runners/test/test_check_runners.py: 11 tests OK.python3(no setup step), withGITHUB_ACTION_PATH,GITHUB_WORKSPACE,RUNNER_TEMP,VISIBILITYset:$RUNNER_TEMP/self-hosted-runners-python, then passes.runs-on: ubuntu-latest: exits 1 with the same error as before.Rollout
Calling repositories pin this action by commit, so merging changes nothing for them until a pin is bumped. After merge the new commit is rolled out canary-first, not to all callers at once:
Cubeage/renovate-config(small config repo, onecontent-checksjob). Bump its pin to the merge commit and confirm itsself-hosted-runnersjob finishes in seconds with no CPython download.Cubeage/fun-mahjong, which carries a vendored copy of the guard as a stopgap; once it passes on the new pin that copy is removed.Calling repositories found by code search (39, current pin
854d150d886e0a4d15846e87e57ca67c7b8c290ewhere checked): Big2TycoonHk, Info, Policy, app-ads.txt, big2-tycoon, big2-tycoon-2, big2-tycoon-keel, big2-tycoon-tw, blackjack-showdown, bloomkin-keel, brand, crumple-keel, cubeage-cs-agent, cubeage-kit, cubeage-native-sdk, cubeage-platform, cubeage-preview-router, dearhouse-keel, fun-big2-hk, fun-big2-tw, fun-mahjong, fun-mahjong-keel, fun-showhand, fun-texas-holdem, jery, last-minute-keel, mahjong-tycoon-tw, mahjong-tycoon-tw-2, mobile-app, planet-post-keel, rank-system, renovate-config, solar2d-ironsource-sdk, solar2d-linux-builds, tenkind-keel, tycoon-engine, unity-runner, voidbite-keel, worldreign-keel.Callers use either
content-checks.ymlorself-hosted-runners.yml(cubeage-kit,dearhouse-keel,worldreign-keel).Risks
Low. A runner with no
python3now fails with an explicit message instead of silently provisioning one; all current runners havepython3(the guard already ran under it infun-mahjong). Rollback: revert this commit and re-pin callers.