Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GitHub Actions Parallel Testing
Search
Yasuhiroki
October 16, 2019
Technology
1
1.3k
GitHub Actions Parallel Testing
2019/10/16 GitHub Actions Meetup Tokyo β の発表資料です
Yasuhiroki
October 16, 2019
Tweet
Share
More Decks by Yasuhiroki
See All by Yasuhiroki
自分に勉強させるには
yasuhiroki
1
430
Android Studio `Command+Shift+A`
yasuhiroki
0
360
シェルスクリプトをサーバーレスで cron したい
yasuhiroki
1
830
rails new コマンド
yasuhiroki
1
770
自動化を習慣化する
yasuhiroki
2
15k
circleci.vim
yasuhiroki
0
1.7k
ベンチャー企業がCircleCIを選んだ理由と活用方法
yasuhiroki
1
810
Rubyの正規表現を調べてみた
yasuhiroki
0
870
開発者(個人)のためのJenkins 運用編
yasuhiroki
0
2.2k
Other Decks in Technology
See All in Technology
How Do I Contact HP Printer Support? [Full 2025 Guide for U.S. Businesses]
harrry1211
0
130
United Airlines Customer Service– Call 1-833-341-3142 Now!
airhelp
0
170
How to Quickly Call American Airlines®️ U.S. Customer Care : Full Guide
flyaahelpguide
0
230
Four Keysから始める信頼性の改善 - SRE NEXT 2025
ozakikota
0
130
NewSQLや分散データベースを支えるRaftの仕組み - 仕組みを理解して知る得意不得意
hacomono
PRO
3
210
データ基盤からデータベースまで?広がるユースケースのDatabricksについて教えるよ!
akuwano
3
150
ソフトウェアテストのAI活用_ver1.25
fumisuke
1
510
SREのためのeBPF活用ステップアップガイド
egmc
1
780
SRE不在の開発チームが障害対応と 向き合った100日間 / 100 days dealing with issues without SREs
shin1988
1
1.1k
Enhancing SaaS Product Reliability and Release Velocity through Optimized Testing Approach
ropqa
1
250
[SRE NEXT] ARR150億円_エンジニア140名_27チーム_17プロダクトから始めるSLO.pdf
satos
3
1.7k
American airlines ®️ USA Contact Numbers: Complete 2025 Support Guide
airhelpsupport
0
390
Featured
See All Featured
Site-Speed That Sticks
csswizardry
10
690
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
The Cost Of JavaScript in 2023
addyosmani
51
8.5k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.9k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
The Pragmatic Product Professional
lauravandoore
35
6.7k
How to train your dragon (web standard)
notwaldorf
96
6.1k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Designing for humans not robots
tammielis
253
25k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Transcript
GitHub Actions Parallel Testing GitHub Actions Meetup Tokyo β A10
Lab Inc. yasuhiroki
⾃自⼰己紹介
Twitter
⾃自⼰己紹介 • A10 Lab Inc. • 元Jenkinsおじさん • 現CircleCIおじさん •
CircleCI User Community Leader
本発表の概要 • GitHub Actions で並列列テスト試してみた • 内容は個⼈人的 Tipsがメイン • 私も含め皆さんの間で情報交換するきっか
けになると嬉しい
本題
やりたいこと 複数のテストを 分割して並列列して実⾏行行したい
matrix を使えばできる • https://github.com/yasuhiroki/parallel-test- github-actions-sample/tree/ b7e78a7c731a6b0590a636ed738eddfe5b3 0f65e/.github/workflows/rspec-parallels-3- node.yml#L8
テスト時間を調整したい 6min 2min 4min 4min 4min 4min job 1 job
2 job 3 job 1 job 2 job 3
CircleCIの例例 • circleci tests split --split-by=timings は CircleCI 上で記録されたファイルごとのテスト実⾏行行 時間を元に振り分けてくれる
container 0 container 1 UFTU@@TQFDSC UFTU@@TQFDSC UFTU@@TQFDSC 過去の記録から振り分ける
knapsack • https://github.com/ArturT/knapsack • ファイルごとのテスト実⾏行行時間を JSON に出 ⼒力力してくれる • その
JSON と並列列数から良い感じに割り振っ てくれる • クラウド版もあるらしい?
knapsack の使⽤用例例 • テスト実⾏行行時間 JSON • https://github.com/yasuhiroki/parallel-test-github-actions- sample/tree/b7e78a7c731a6b0590a636ed738eddfe5b30f65e/ knapsack_rspec_report.json •
Workflow 例例 • https://github.com/yasuhiroki/parallel-test-github-actions- sample/tree/ b7e78a7c731a6b0590a636ed738eddfe5b30f65e/.github/ workflows/rspec-parallels-knapsack.yml#L21
テスト結果を集計したい
• artifact を使う テスト結果を集計したい uses: actions/upload-artifact@master with: name: reports path:
reports reports
• artifact を使う テスト結果を集計したい uses: actions/download-artifact@master with: name: reports reports
毎回 install するのやめたい • キャッシュ機能がリリースされるのを待とう
毎回 install するのやめたい • 同じ Workflow 内なら artifact が使えるかも? •
upload が遅くて逆効果だった • https://github.com/yasuhiroki/enjoy- github-actions/commit/ 9e8e9de9c6898f1fc9f491fe11e75e87a4b 5d0cb/checks?check_suite_id=266056589
リポジトリURL • https://github.com/yasuhiroki/enjoy-github- actions • https://github.com/yasuhiroki/parallel-test- github-actions-sample
Tips集紹介
actions/github-script • JavaScriptを直接 YAML に書けちゃう •
GitHub token 取得⽅方法 • 実は2パターン書き⽅方がある • secrets.GITHUB_TOKEN • github.token •
commit_comment is not a valid event name • 急に is
not a valid って⾔言われるようになった
ご清聴ありがとうございました