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
520
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
380
GitHub composite actions
hkusu
2
260
Android の静的解析における SARIF ファイルの活用
hkusu
0
3.5k
CI_でライブラリのバージョンの変化をレポートする.pdf
hkusu
0
260
Maestro を GitHub Actions で動かす 〜Android編〜
hkusu
0
1.1k
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
840
Other Decks in Technology
See All in Technology
小さな勉強会の始め方、広げ方、あるいは友達の作り方 / How to Start, Grow, and Build Connections with Small Study Groups
ar_tama
6
3.1k
LINE-ChatGPT 倫理問題を整理する全力肯定彼氏くん [LuC4]に訪れたサービス開始以来の最大の危機
o_ob
2
170
パートナー企業のテクニカルサポートエンジニアとして気になる、より良い AWS サポートの利活用について
kazzpapa3
0
120
Product Utilization of Large Language Models Starting Today
ymatsuwitter
3
1.6k
KubeVirt Networking ONIC 2024
orimanabu
4
680
ラブグラフ紹介資料 〜プロダクト解体新書〜 / Lovegraph Product Deck
lovegraph
0
14k
What a Good Platform Looks Like and How to Get There @ Large Financial Organization, Oct 2024
mfpais
PRO
0
110
データ分析基盤のためにS3を深堀りする~アーキテクチャ設計の考え方のヒントに~
nrinetcom
PRO
1
310
【完全版】Dify - LINE Bot連携 考え方と実用テクニック
uezo
2
640
DenoでもViteしたい!インポートパスのエイリアスを指定してラクラクアプリ開発
bengo4com
2
2k
0x5F3759DF
ykozw
0
100
今日から始める技術的負債の解消
leveragestech
3
200
Featured
See All Featured
The Brand Is Dead. Long Live the Brand.
mthomps
53
38k
Visualization
eitanlees
143
15k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Designing for Performance
lara
604
68k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
GraphQLとの向き合い方2022年版
quramy
43
13k
A better future with KSS
kneath
237
17k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
9
600
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
12
1.6k
Art, The Web, and Tiny UX
lynnandtonic
296
20k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
167
49k
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 ΤϯδχΞΛ ઈࢍืूத Ͱ͢ʂ