Skip to content

perf: Chrome for Testingとaction依存をactions/cacheでキャッシュ - #8

Merged
sgash708 merged 1 commit into
mainfrom
perf/ci-caching
Aug 8, 2026
Merged

perf: Chrome for Testingとaction依存をactions/cacheでキャッシュ#8
sgash708 merged 1 commit into
mainfrom
perf/ci-caching

Conversation

@sgash708

@sgash708 sgash708 commented Aug 8, 2026

Copy link
Copy Markdown
Owner

概要

「速さで戦う」施策の1つ目。composite action内のCIステップをキャッシュして実行時間を短縮する。

実測(chromagic-demoでの計測、単一実行)

ステップ 所要時間
Install Japanese fonts (apt-get) 約11.3秒
Setup Chrome for Testing 約7.5秒
Install action dependencies (npm ci) 約4秒
Capture stories (storycap) 約7.2秒

変更内容

  • actions/cache/restore + actions/cache/save で以下をキャッシュ
    • Chrome for Testing (${{ runner.tool_cache }}/setup-chrome) — browser-actions/setup-chromeは内部でRUNNER_TOOL_CACHEを使うが、GitHub-hosted runnerは毎回使い捨てVMなのでジョブをまたいでは残らない。actions/cacheで永続化する
    • action自体のnode_modules (${{ github.action_path }}/node_modules) — package-lock.jsonのハッシュをキーに

Noto CJKフォントのキャッシュ化は /usr/share/fonts 配下がroot所有で actions/cache の復元権限まわりの検証が必要なため今回は見送り(将来課題)。

動作確認

  • actionlint OK (exit 0)
  • YAML構文チェック OK
  • 実際のキャッシュヒット効果はマージ後にchromagic-demoで2回連続実行して計測予定

🤖 Generated with Claude Code

composite action内訳の実測(chromagic-demoでの計測):
- Install Japanese fonts: 約11.3秒
- Setup Chrome for Testing: 約7.5秒
- Install action dependencies (npm ci): 約4秒
- Capture stories (storycap): 約7.2秒

browser-actions/setup-chromeはRUNNER_TOOL_CACHE配下にキャッシュする作りだが、
GitHub-hosted runnerは毎回使い捨てVMなのでジョブをまたいでは残らない。
actions/cache/restore+saveで永続化し、2回目以降のダウンロードをスキップする。
action自体のnode_modules(storycap等)もpackage-lock.jsonハッシュでキャッシュ。

Noto CJKフォントのキャッシュ化は、/usr/share/fonts配下がroot所有で
actions/cacheの復元権限まわりの検証が必要なため今回は見送り(将来課題)。
@sgash708
sgash708 merged commit c66e006 into main Aug 8, 2026
2 checks passed
@sgash708
sgash708 deleted the perf/ci-caching branch August 8, 2026 10:31
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.2.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant