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
Android の CI(GitHub Actions)の改善で、最近やったこと
Search
Hiroyuki Kusu
March 07, 2023
Technology
0
550
Android の CI(GitHub Actions)の改善で、最近やったこと
YUMEMI.grow Mobile #1 (
https://yumemi.connpass.com/event/272491/
) の資料
Hiroyuki Kusu
March 07, 2023
Tweet
Share
More Decks by Hiroyuki Kusu
See All by Hiroyuki Kusu
モノレポのプルリクエストに最近、導入したもの
hkusu
2
410
GitHub composite actions
hkusu
2
290
Android の静的解析における SARIF ファイルの活用
hkusu
0
4.6k
CI_でライブラリのバージョンの変化をレポートする.pdf
hkusu
0
290
Maestro を GitHub Actions で動かす 〜Android編〜
hkusu
0
1.2k
Tauri Mobile で生成される Android のコードを見てみる
hkusu
0
1.3k
Custom GitHub Actions を作って Organization 内で共有する
hkusu
1
480
GitHub Actions でユニットテストの結果をレポートする
hkusu
0
3.2k
Android で Multiplatform Settings を使う
hkusu
0
900
Other Decks in Technology
See All in Technology
AI時代のデータセンターネットワーク
lycorptech_jp
PRO
1
280
20241220_S3 tablesの使い方を検証してみた
handy
4
390
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
110
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
480
alecthomas/kong はいいぞ / kamakura.go#7
fujiwara3
1
300
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
260
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
250
5分でわかるDuckDB
chanyou0311
10
3.2k
複雑性の高いオブジェクト編集に向き合う: プラガブルなReactフォーム設計
righttouch
PRO
0
110
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
150
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
170
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Building Adaptive Systems
keathley
38
2.3k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
4 Signs Your Business is Dying
shpigford
181
21k
A designer walks into a library…
pauljervisheath
204
24k
Transcript
Android ͷ CIʢGitHub Actionsʣ ͷվળͰɺ࠷ۙͬͨ͜ͱ 2023.3.7 YUMEMI.grow Mobile #1 Hiroyuki
Kusu ( @hkusu_ )
About me
1. ϓϧϦΫΤετʹΞϓϦΠϯετʔϧ༻ ͷ QR ίʔυΛίϝϯτ
https://github.com/marketplace/actions/s3-upload-action
- uses: actions/checkout@v 3 - uses: actions/setup-java@v 2 with
: java-version: 1 1 distribution: 'zulu ' - run: ./gradlew assembleDebu g - uses: hkusu/s3-upload-action@v 2 id: uploa d with : aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID } } aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY } } aws-region: 'ap-northeast-1 ' aws-bucket: ${{ secrets.AWS_BUCKET } } file-path: './app/build/outputs/apk/debug/app-debug.apk ' output-file-url: 'true ' content-type: 'application/vnd.android.package-archive ' output-qr-url: ‘true ' public: 'true ' - ... ͋ͱϚʔΫμϯܗࣜͷը૾ϦϯΫ ![QR](${{ steps.upload.outputs.qr-url }}) Λίϝϯτ͢ΕOK ※ ͋Β͔͡Ί Amazon S3 ͷ bucket Λͻͱͭ༻ҙ͓ͯ͘͠ඞཁ͕͋Γ·͢ apkϑΝΠϧμϯϩʔυ༻ͷHTTPϨεϙϯεϔομ
• ϨϏϡΞʔ͕खݩͷ࣮ػͰଈ࠲ʹಈ࡞ΛݟΔ͜ͱ͕Ͱ͖Δ • खݩͰίʔυΛνΣοΫΞτͯ͠Ϗϧυ͢Δख͕ؒͳ͍ • Slack ϝʔϧͰͷ URL ͷ௨ͱҧ͍ɺͲͷϓϧϦΫΤετͷͲͷίϛοτ
ʹରͯ͠Ϗϧυ͞ΕͨΞϓϦͳͷ͔͔Γ͍͢ • ͨͩ public ͳ URL Ͱ͋ΔͷͰར༻γʔϯʹ͍ͭͯҙ • ར༻͢Δ߹Ͱ URL ʹ༗ޮظݶઃ͚͓͍ͯͨํ͕Α͍ • S3 ͷϥΠϑαΠΫϧͷઃఆͰɺҰఆظؒͰ apk ϑΝΠϧΛࣗಈআ • ·ͨ S3 ͷ Presigned URL Λར༻ʢ͜ͷ Action ͷΦϓγϣϯͰར༻Մʣ • ༗ޮظݶ͕ΕͯϫʔΫϑϩʔΛ࠶࣮ߦ͢Ε QR ίʔυ࠶ੜ͞ΕΔ
2. larger runners ͷར༻
• runner Λز͔ͭ࡞ͬͯ group ʹͿΒԼ͛Δ • ୯ମͷ runner εέʔϧ͢Δ͕ɺ͍·ݱࡏ
εέʔϧʹ͕͔͔࣌ؒΔҝɺrunner Λͨ ͘͞Μ࡞Δ͜ͱͰෳϫʔΫϑϩʔɾδϣϒ ͔Βͷಉ࣌ར༻ʹඋ͑Δ
jobs : hoge : env : GRADLE_OPTS: ‘-Dorg.gradle.parallel=true -Dorg.gradle.jvmargs=-Xmx5120m
' runs-on : group: android-ci-ubuntu-22.0 4 steps : ... ࡞ͨ͠άϧʔϓΛࢦఆ • ڥม GRADLE_OPTS Ͱ Gradle ͷΦϓγϣϯΛࢦఆ • ΦϓγϣϯϓϩδΣΫτͷ Gradle ϑΝΠϧͰఆٛͯ͠Α͍͕ɺϩʔΧϧ։ൃͱ CI Ͱ͚ͨํ͕Αͦ͞͏ͳͷͰɺ͜ͷΑ͏ʹڥมͰࢦఆ͢Δͷ͕ศར • parallel ʹ͢Δ͜ͱͰɺlarger runners ͷ CPU ίΞΛ࠷େݶɺ׆༻ͤ͞Δ • larger runners ϝϞϦଟ͘ੵΜͰ͍ΔͷͰɺ5G Λࢦఆʢͬͱଟͯ͘Α͍͔ʣ
• ࠓճͷྫͰ 8 core ͷ runner Λར༻͍ͯ͠Δ͕ 4 core
Ͱे͔͠Ε ͳ͍ʢ࠷େ 64 coreʣ • larger runers core ʹൺྫͨ͠՝ֹۚͱͳΔ͕ɺେͷ Gradle λεΫ core Λ 2 ഒʹ͔ͨ͠Βͱ͍͕ͬͯ 1/2 ʹͳΔ༁Ͱͳ͍ • ίεύͱ͍͏ҙຯͰΑ͘ͳ͍ • ྫ͑ϓϧϦΫ࣌ͷϫʔΫϑϩʔͳͲɺΛ༏ઌ͍ͨ͠߹ͷΈར༻ ͢Δͷ͕Αͦ͞͏ • larger runners ແྉͷର֎ͳͷͰҙ
3. GradleϏϧυΩϟογϡͷར༻
jobs : hoge : env : GRADLE_OPTS: ‘-Dorg.gradle.daemon=false -Dorg.gradle.caching=true
' runs-on: ubuntu-22.0 4 steps : - uses: actions/checkout@v 3 - uses: actions/setup-java@v 2 with : java-version: 1 1 distribution: 'zulu ' - uses: actions/cache@v 3 with : path: | ~/.gradle/cache s ~/.gradle/wrappe r ~/.android/build-cach e key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle- wrapper.properties', '**/buildSrc/**/*.kt', '**/libs.versions.toml') } } restore-keys: ${{ runner.os }}-gradle - - ... Gradle ͷϏϧυΩϟογϡΛ༗ޮԽ actions/caches Λར༻͢ΔࡍσʔϞϯΛແޮԽ͓ͯ͘͜͠ͱ ͍ͭͰʹ Android ͷϏϧυΩϟογϡར༻ Gradle ͷϏϧυΩϟογϡґଘϥΠϒϥϦͷΩϟογϡͱڞʹ ͜ͷσΟϨΫτϦԼʹؚ·ΕΔ
• CI ͰޮՌΛಘΔͷ͍͠ʁฐࣾͰେ͖ͳޮՌײ͡ΒΕͳ͔ͬͨ • ಉ͡ίʔυ͔ͭಉ͡ Gradle λεΫΛ୯७ʹ࠶࣮ߦ͢Δ໘Ͱ͔ͨ͠ʹ͍ • ͨͩ
CI ͰΩϟογϡͨ࣌͠ͱར༻͢Δ࣌Ͱίʔυ͕มԽ͍ͯ͠Δ͜ͱ͕ຆͲ • ࣮ߦ͍ͨ͠ Gradle λεΫຖ·ͨશ෦ೖΓͷΩϟογϡΛ༻ҙ͓ͯ͘͠ͷ͕͍͠ • GitHub ͰΩϟογϡτʔλϧ 10 G ·Ͱͱ͍͏੍ݶ͋Δ • ϩʔΧϧ։ൃ࣌ͱҧ͍ɺ։ൃͰੵΈ্͕ͬͨΩϟογϡ͕ར༻Ͱ͖Δ༁Ͱͳ͍ • ͱ͍͑େ͖ͳσϝϦοτແ͍ͷͰɺؾ࣋ͪఔʹಋೖ͓͍ͯͯ͠Αͦ͞͏ • σϝϦοτΩϟογϡαΠζ͕গ͠େ͖͘ͳΔ͙Β͍ʁ • Ұճͷ Gradle λεΫͰ͋ͬͯɺλεΫ࣮ߦதͷՌͷ࠶ར༻͕ߦΘΕΔ
4. ࣦഊͨ͠ςετίʔυʹίϝϯτ͢Δ
https://speakerdeck.com/hkusu/github-actions-deyunitutotesutofalsejie-guo-worepotosuru
5. ϫʔΫϑϩʔͷڞ௨Խ
https://speakerdeck.com/hkusu/custom-github-actions-wozuo-tute-organization-nei-degong-you-suru
Thank you ! @hkusu_ ฐࣾ Android ΤϯδχΞΛ ઈࢍืूத Ͱ͢ʂ