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
540
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
400
GitHub composite actions
hkusu
2
280
Android の静的解析における SARIF ファイルの活用
hkusu
0
4.1k
CI_でライブラリのバージョンの変化をレポートする.pdf
hkusu
0
280
Maestro を GitHub Actions で動かす 〜Android編〜
hkusu
0
1.2k
Tauri Mobile で生成される Android のコードを見てみる
hkusu
0
1.2k
Custom GitHub Actions を作って Organization 内で共有する
hkusu
1
460
GitHub Actions でユニットテストの結果をレポートする
hkusu
0
3.2k
Android で Multiplatform Settings を使う
hkusu
0
880
Other Decks in Technology
See All in Technology
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
750
DMARC 対応の話 - MIXI CTO オフィスアワー #04
bbqallstars
1
160
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
300
フルカイテン株式会社 採用資料
fullkaiten
0
40k
複雑なState管理からの脱却
sansantech
PRO
1
140
なぜ今 AI Agent なのか _近藤憲児
kenjikondobai
4
1.4k
Exadata Database Service on Dedicated Infrastructure(ExaDB-D) UI スクリーン・キャプチャ集
oracle4engineer
PRO
2
3.2k
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
380
強いチームと開発生産性
onk
PRO
34
11k
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
430
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
210
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
870
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
The Cult of Friendly URLs
andyhume
78
6k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
A Modern Web Designer's Workflow
chriscoyier
693
190k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
A Tale of Four Properties
chriscoyier
156
23k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
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 ΤϯδχΞΛ ઈࢍืूத Ͱ͢ʂ