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 composite actions
Search
Hiroyuki Kusu
March 13, 2024
Technology
2
270
GitHub composite actions
YUMEMI.grow Mobile #11 (
https://yumemi.connpass.com/event/311373/
) の資料
Hiroyuki Kusu
March 13, 2024
Tweet
Share
More Decks by Hiroyuki Kusu
See All by Hiroyuki Kusu
モノレポのプルリクエストに最近、導入したもの
hkusu
2
390
Android の静的解析における SARIF ファイルの活用
hkusu
0
3.8k
CI_でライブラリのバージョンの変化をレポートする.pdf
hkusu
0
270
Maestro を GitHub Actions で動かす 〜Android編〜
hkusu
0
1.2k
Android の CI(GitHub Actions)の改善で、最近やったこと
hkusu
0
530
Tauri Mobile で生成される Android のコードを見てみる
hkusu
0
1.2k
Custom GitHub Actions を作って Organization 内で共有する
hkusu
1
460
GitHub Actions でユニットテストの結果をレポートする
hkusu
0
3.1k
Android で Multiplatform Settings を使う
hkusu
0
860
Other Decks in Technology
See All in Technology
マネジメント視点でのre:Invent参加 ~もしCEOがre:Inventに行ったら~
kojiasai
0
390
バクラクにおける可観測性向上の取り組み
yuu26
3
380
君は隠しイベントを見つけれるか?
mujyun
0
230
AWS CDKでデータリストアの運用、どのように設計する?~Aurora・EFSの実践事例を紹介~/aws-cdk-data-restore-aurora-efs
mhrtech
4
560
初心者に Vue.js を 教えるには
tsukuha
5
370
GitHub Universe: Evaluating RAG apps in GitHub Actions
pamelafox
0
170
カメラを用いた店内計測におけるオプトインの仕組みの実現 / ai-optin-camera
cyberagentdevelopers
PRO
1
120
Figma Dev Modeで進化するデザインとエンジニアリングの協働 / figma-with-engineering
cyberagentdevelopers
PRO
1
410
「最高のチューニング」をしないために / hack@delta 24.10
fujiwara3
19
3.2k
Emacs x Nostr
hakkadaikon
1
140
端末が簡単にリモートから操作されるデモを通じて ソフトウェアサプライチェーン攻撃対策の重要性を理解しよう
kitaji0306
0
170
【若手エンジニア応援LT会】AWSで繋がり、共に成長! ~コミュニティ活動と新人教育への挑戦~
kazushi_ohata
0
150
Featured
See All Featured
Done Done
chrislema
181
16k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
504
140k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
13
1.9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
7.9k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
A better future with KSS
kneath
238
17k
Scaling GitHub
holman
458
140k
Embracing the Ebb and Flow
colly
84
4.4k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Automating Front-end Workflow
addyosmani
1365
200k
Transcript
GitHub composite actions 2024.3.13 YUMEMI.grow Mobile #11 Hiroyuki Kusu (
@hkusu_ )
About me
composite actions ?
composite actions ? • GitHub custom actions ͷ࡞Γํͷ1ͭ •
ଞʹ Docker container actions ͱ JavaScript actions ͕͋Δ • ෳͷ step Λ 1ͭͷ action ʹ·ͱΊΒΕΔ • ެ։͞Ε͍ͯΔطଘͷ action ར༻Ͱ͖Δ • ීஈ GitHub Actions ͷϫʔΫϑϩʔͷ YAML Λॻ͘ײ֮Ͱ࡞ΕΔ • ϩδοΫ෦ओʹ Shell script Ͱॻ͘͜ͱʹͳΔ • େ͖ͳػೳͷ։ൃʹ͔ͳͦ͏ uses: actions/setup-java@v4 custom actions ͷར༻ྫ
name: "Setup Java - Gradle" description: "A GitHub Action
that sets up a Java and Gradle environment." author: "YUMEMI Inc." branding: icon: "box" color: "blue" inputs: java-version: description: "Java version to use." required: false default: "17" // ... kotlin-compiler-report: description: "Whether to apply Kotlin compiler Problem Matchers." required: false default: "true" runs: using: "composite" steps: - name: Setup Java uses: actions/setup-java@v4 with: distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 with: cache-disabled: ${{ inputs.cache-disabled }} cache-read-only: ${{ inputs.cache-read-only }} gradle-home-cache-cleanup: ${{ inputs.gradle-home-cache-cleanup }} add-job-summary: ${{ inputs.gradle-build-report }} - name: Setup Problem Matchers if: inputs.kotlin-compiler-report != 'false' uses: yumemi-inc/problem-matchers/kotlin-gradle@v1 composite action ͷதͷྫ https://github.com/yumemi-inc/setup-java-gradle action.yml ͱͯ͠ϦϙδτϦʹอଘ͢Ε ผϦϙδτϦͷϫʔΫϑϩʔ͔Β uses Ͱ ར༻Ͱ͖ΔʢಉҰϦϙδτϦͷϫʔΫϑ ϩʔ͔Βར༻͢ΔͷՄʣ
͜Ε·Ͱࢲ͕࡞ͨ͠ composite action
͜Ε·Ͱࢲ͕࡞ͨ͠ composite action • Ұൠެ։Ͱ͖Δͷࣾͷ public ϦϙδτϦʹஔ͍ͯ͋Δ • Խࢧԉͱ͍͏ۀͷੑ্࣭ɺࣾ֎ͷ
GitHub organization Ͱར༻ Ͱ͖ΔΑ͏ʹ • GitHub Marketplace Ͱެ։ • Marketplace Ͱެ։͠ͳͯ͘ར༻Ͱ͖Δ͕ɺͰ͖Δ͚ͩ෯͍ਓʹ ͬͯΒ͏ҝʹ • ୯७ʹ OSS తͳߩݙͷత • ͱ͍͑Ұൠެ։Ͱ͖ͳ͍ͷ͚ࣾͩͰ͏ͷ private ϦϙδτϦͰ
Gradle Dependency Diff Report https://github.com/yumemi-inc/gradle-dependency-diff-report
Gradle Dependency Diff Report • 1ͭͷϥΠϒϥϦͷόʔδϣϯΛม͑ͨΒҶͮΔࣜʹผͷϥΠϒϥϦͷόʔ δϣϯมΘͬͯ͠·͏ • Renovate
Dependabot લऀͷ1ͭͷϥΠϒϥϦͷ͜ͱҎ֎ڭ͑ͯ ͘Εͳ͍ • ͳͷͰϥΠϒϥϦͷґଘؔͷมԽΛ Job Summaries Ϩϙʔτ͢Δ action Λ࡞ͬͨ • ϨϏϡʔ࣌ʹ׆༻
Comment Pull Request https://github.com/yumemi-inc/comment-pull-request
Comment Pull Request • ϓϧϦΫίϝϯτΛߘ͢Δ action • աڈͷίϝϯτΛফͨ͠ΓӅͨ͠ΓͰ͖Δ •
ςετ݁ՌͷϨϙʔτߘͳͲɺ࠷ޙͷίϛοτʹର͢Δ CI ͷ݁ՌͷΈ ʹؔ৺͕͋ΔΑ͏ͳέʔεͰར༻
Changed Files https://github.com/yumemi-inc/changed- fi les
• ࢦఆͨ͠ύεύλʔϯͷϑΝΠϧ͕ϓϧϦΫҙͷίϛοτͷࠩʹؚ· ΕΔ͔ఆ͢Δ action • step ୯ҐͷॲཧͷذεΩοϓ͕ՄೳͱͳΔ • ಛʹϞϊϨϙɺϚϧνϓϥοτϑΥʔϜܥͷϦϙδτϦͰ༗༻ʁ
Changed Files
Path Filter https://github.com/yumemi-inc/path- fi lter
Path Filter • ઌఔͷ Changed Files ɺGitHub API Λར༻͍ͯ͠Δ͜ͱʹΑΔ੍͕
͋ͬͨʢREADME ʹͦͷࢫΛهࡌࡁΈʣͷͰɺগ͠ػೳΛল͖ͭͭ GitHub API Λར༻͠ͳ͍ํࣜͰ࣮ͨ͠͠ • ͍ͣΕল͍ͨػೳΛऔΓࠐΜͰɺ͜ͷ Path Filter ʹ̍ຊԽ͢Δ༧ఆ
Problem Matchers for Kotlin - Gradle https://github.com/yumemi-inc/problem-matchers
Problem Matchers for Kotlin - Gradle • Kotlin ίϯύΠϧ࣌ͷϫʔχϯά/ΤϥʔΛ
annotation ͱͯ͠ϓϧϦΫͷม ߋϑΝΠϧλϒͱ Job Summaries දࣔ • Kotlin 1.7 Ҏલͱ 1.8 Ҏ߱ͷ྆ϑΥʔϚοτʹରԠ • GitHub ͷ੍ʹΑΓɺannotation ͷʹݶΓ͕͋Δ
Setup Java - Gradle https://github.com/yumemi-inc/setup-java-gradle
Setup Java - Gradle • Gradle λεΫ࣮ߦલͷ֤छηοτΞοϓΛ 1 step Ͱॻ͚ΔΑ͏ʹͨ͠ͷ
• ෦Ͱ༻͍ͯ͠Δ gradle/gradle-build-action Λͦͷ··Կߟ͑ͣ͏ ͱσϑΥϧτϒϥϯνʹແҙຯʹΩϟογϡ͕େྔʹ࡞͞ΕͨΓɺٯʹϓ ϧϦΫͰΩϟογϡ͕Ұ hit ͠ͳ͔ͬͨΓ͢ΔͷͰɺΩϟγϡ࡞جຊ off ͷܗͰϥοϓ͠ɺREADME ͰΩϟγϡͷӡ༻ʹ͍ͭͯิͨ͠
ॴײ Tips ͳͲ
ॴײ Tips ͳͲ • σϑΥϧτͰར༻Ͱ͖Δ jq GitHub CLI ͕ศར
• GitHub CLI GraphQL ୟ͚Δ • Ҏલ؆୯ͳ custom action Ͱ JavaScriptʢJavaScript actionsʣͰ࡞ͬ ͍͕ͯͨɺఆظతʹ Node.js ͷόʔδϣϯ੬ऑੑͷ͋ΔϥΠϒϥϦͷߋ ৽͕ඞཁͩͬͨͷͰɺͦͷख͕ؒͳ͍ • ͨͩෳࡶͳͷΛ࡞Ζ͏ͱ͢Δͱ Shell script ྗ͕ΘΕΔ͔ʁ
JavaScript طଘͷ npm ͷύοέʔδΛ͍͍ͨ߹ • actions/github-script action Λར༻ͯ͠ JavaScript ͕ॻ͚Δ
• npm ͷύοέʔδΛར༻͢Δྫɺઌ΄Ͳհͨ͠ Path Filterʢyumemi- inc/path- fi lterʣͷίʔυதʹ͋Γ·͢ • @vercel/ncc Ͱόϯυϧͨ͠ͷΛ require() ͰಡΈࠐΜͰ͍Δ
̏ͭͷ runner OS ͷߟྀ • GitHub-hosted runner ͷ OS ̏ͭʢUbuntuɺmacOSɺWindowsʣ͋Δ
• Shell script Λ Bash Ͱॻ͘ݶΓɺಉ͡ॻ͖ํͰ͍͍ͩͨΑ͍͕ɺԼهͷ ҧ͍͕͋Δ͜ͱʹҙ • Windows OS ͷվߦίʔυ • OS ʹΑͬͯଘࡏ͠ͳ͍ɾڍಈ͕ҟͳΔίϚϯυ͕͋Δ • ։ൃ࣌ͷ CI Λ̏ͭͷ OS Ͱճ͢ͱΑ͍ • public ϦϙδτϦͳΒແྉͳͷͰ࣌ؒΛؾʹͤͣճͤΔ
Thank you ! @hkusu_ ͥͻօ͞ΜศརͳͷΛ࡞ͬͯڞ༗͍ͯͩ̇͘͠͞