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
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
1
110
podman_update_2024-12
orimanabu
1
260
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
270
サーバレスアプリ開発者向けアップデートをキャッチアップしてきた #AWSreInvent #regrowth_fuk
drumnistnakano
0
190
TSKaigi 2024 の登壇から広がったコミュニティ活動について
tsukuha
0
160
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
2
230
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
260
ガバメントクラウドのセキュリティ対策事例について
fujisawaryohei
0
520
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
510
.NET 9 のパフォーマンス改善
nenonaninu
0
280
DevOps視点でAWS re:invent2024の新サービス・アプデを振り返ってみた
oshanqq
0
180
AIのコンプラは何故しんどい?
shujisado
1
190
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
We Have a Design System, Now What?
morganepeng
51
7.3k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
KATA
mclloyd
29
14k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
4 Signs Your Business is Dying
shpigford
181
21k
Facilitating Awesome Meetings
lara
50
6.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
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 ΤϯδχΞΛ ઈࢍืूத Ͱ͢ʂ