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.2k
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
380
Android Studio `Command+Shift+A`
yasuhiroki
0
300
シェルスクリプトをサーバーレスで cron したい
yasuhiroki
1
750
rails new コマンド
yasuhiroki
1
690
自動化を習慣化する
yasuhiroki
2
14k
circleci.vim
yasuhiroki
0
1.5k
ベンチャー企業がCircleCIを選んだ理由と活用方法
yasuhiroki
1
760
Rubyの正規表現を調べてみた
yasuhiroki
0
770
開発者(個人)のためのJenkins 運用編
yasuhiroki
0
2.1k
Other Decks in Technology
See All in Technology
VPoE Meetup Vol.1 VPoEとして実践してきたことと反省点
coconala_engineer
2
200
Automated Tests Now and Future @ SQiP Workshop Special Lecture 2024
teyamagu
PRO
2
530
SwiftSyntaxでUIKitとSwiftUIの使用率を完璧に計測できちゃう件について
ldf_tech
0
150
SOLID - Architecture and Architectural Decisions - Devfest Goa 2024
rivuchk
0
180
Oracle Cloud Infrastructure:2024年10月度サービス・アップデート
oracle4engineer
PRO
0
290
いまいまMySQL2024 @ OSC Nagaoka
sakaik
3
310
フェンリルの SwiftUI の研修を覗いてみる / Fenrir SwiftUI Training
studio_rookery
0
170
強すぎるIAMをCloudTrailを使って適正化した話
yjszk
0
200
JBoss EAPによるクラウドネイティブのススメ
chiroito
0
150
20241017_俺たちは雰囲気で scope をやっているけどもうちょっとなんとかならんのか?
tokai235
0
420
WebRTC と Wasm の関係を振り返ってみた
tetter27
0
190
GopherのMakefile愛はどこからきているのか教えてほしい #fukuokago/Gophers love Makefile
quiver
2
160
Featured
See All Featured
Producing Creativity
orderedlist
PRO
341
39k
No one is an island. Learnings from fostering a developers community.
thoeni
19
2.9k
Practical Orchestrator
shlominoach
186
10k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.6k
Agile that works and the tools we love
rasmusluckow
327
21k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
26
4.1k
Side Projects
sachag
452
42k
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
59k
Typedesign – Prime Four
hannesfritz
39
2.4k
Code Review Best Practice
trishagee
64
17k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
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 って⾔言われるようになった
ご清聴ありがとうございました