ci: cache c2a-boom-tools binaries in pytest workflow#490
Open
sksat (sksat) wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce flaky failures during pytest CI setup by caching c2a-boom-tools binaries via actions/cache, so that when the cache hits the boom-tools preinstall can restore binaries locally and avoid any network access.
Changes:
- Add a CI-only restore/save path in
examples/*/boom-tools/install.shcontrolled byC2A_BOOM_TOOLS_CACHE_DIR. - Replace the existing (effectively no-op) devtools cache step in
pytest.ymlwith a cache for the boom-tools binary directory keyed by theinstall.shhash. - Wire
C2A_BOOM_TOOLS_CACHE_DIRinto the workflow sopnpm installcan reuse cached boom-tools binaries.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
examples/mobc/boom-tools/install.sh |
Restore/save boom-tools binaries from/to a cache directory when C2A_BOOM_TOOLS_CACHE_DIR is set. |
examples/subobc/boom-tools/install.sh |
Same cache restore/save behavior as mobc for consistency across users. |
.github/workflows/pytest.yml |
Cache ${{ runner.temp }}/c2a-boom-tools and set C2A_BOOM_TOOLS_CACHE_DIR for the pnpm install step. |
Comments suppressed due to low confidence (2)
examples/mobc/boom-tools/install.sh:31
cargo-binstallis invoked without--locked. Ifcargo-binstallfalls back to a source build (e.g., after a fetch timeout), Cargo may resolve newer transitive dependencies than the pinned toolchain supports, causing deterministic CI failures (the same issue described in PR #488). Add--lockedto allcargo-binstallinvocations so the fallback build uses each crate'sCargo.lock.
./bin/cargo-binstall --root . tmtc-c2a --version 1.1.1 --no-confirm
./bin/cargo-binstall --root . tlmcmddb-cli --version 2.6.1 --no-confirm
./bin/cargo-binstall --root . kble --version 0.4.2 --no-confirm
./bin/cargo-binstall --root . kble-serialport --version 0.4.2 --no-confirm
examples/subobc/boom-tools/install.sh:31
cargo-binstallis invoked without--locked. Ifcargo-binstallfalls back to a source build (e.g., after a fetch timeout), Cargo may resolve newer transitive dependencies than the pinned toolchain supports, causing deterministic CI failures. Add--lockedto allcargo-binstallinvocations so the fallback build uses each crate'sCargo.lock.
./bin/cargo-binstall --root . tmtc-c2a --version 1.1.1 --no-confirm
./bin/cargo-binstall --root . tlmcmddb-cli --version 2.6.1 --no-confirm
./bin/cargo-binstall --root . kble --version 0.4.2 --no-confirm
./bin/cargo-binstall --root . kble-serialport --version 0.4.2 --no-confirm
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The boom-tools preinstall downloads prebuilt binaries via cargo-binstall on every CI run. When the binstall fetchers hit a network timeout, it silently falls back to building from source, which currently always fails (edition 2024 transitive deps vs the pinned Rust 1.81.0 toolchain), making pytest CI flaky. Teach install.sh to restore/save binaries from a cache directory given via C2A_BOOM_TOOLS_CACHE_DIR (opt-in; local behavior is unchanged when unset), and wire it to actions/cache keyed on the hash of install.sh, which contains all tool versions. On a cache hit the preinstall now performs no network access at all. This replaces the stale 'Cache C2A devtools' step, which referenced examples/mobc/tools/ — a path that no longer exists (renamed to boom-tools/) — and therefore cached nothing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1c1f588 to
b0ef4ea
Compare
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.
概要
pytest CI が稀に setup 段階で落ちる flake の修正その 2(その 1 は #488)。boom-tools のバイナリ群を actions/cache でキャッシュし、キャッシュヒット時は preinstall がネットワークに一切出ないようにする。
背景
#488 に書いたとおり、flake の入口は cargo-binstall の fetcher のネットワークタイムアウト。#488 はタイムアウト後の fallback ビルドを直すものだが、本 PR はそもそも毎回のダウンロード自体を不要にして、ネットワーク起因の失敗確率と CI 時間を下げる。
変更内容
install.sh(mobc / subobc 共通):C2A_BOOM_TOOLS_CACHE_DIRが設定されている場合、./bin/に復元して即終了(cargo-binstall のダウンロードも含めて network access ゼロ)pytest.yml:examples/mobc/tools/(boom-tools/への改名前のパス)を参照しており、実際には何もキャッシュしていなかった(hashFiles の対象も存在しないため key も縮退していた)install.shの hashFiles。ツールのバージョンはすべてinstall.sh内に書かれているので、バージョン更新時に自然に key が変わるexamples/mobcのため)動作確認
ローカルで restore パス(完全キャッシュ → 復元して即終了、ネットワーク不要)と miss パス(欠けあり → 通常インストールへ進む)の両方を確認済み。
備考
install.shで軽微に conflict するので、先にマージされた方に追従して rebase する🤖 Generated with Claude Code