-
Notifications
You must be signed in to change notification settings - Fork 1.5k
110 lines (96 loc) · 3.71 KB
/
Copy pathbuild-develop.yml
File metadata and controls
110 lines (96 loc) · 3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Build Develop
permissions:
contents: read
on:
push:
branches:
- 'develop'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run-eslint-and-test:
name: ESLint and Test
if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }}
uses: ./.github/workflows/eslint.yml
generate-changelog:
name: Generate Release Changelog
needs: [run-eslint-and-test]
uses: ./.github/workflows/generate-changelog.yml
android-build-store:
name: Build Android
if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }}
uses: ./.github/workflows/build-android.yml
needs: [run-eslint-and-test, generate-changelog]
secrets: inherit
with:
trigger: develop
ios-build-store:
name: Build iOS
if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }}
uses: ./.github/workflows/build-ios.yml
needs: [run-eslint-and-test, generate-changelog]
secrets: inherit
with:
trigger: develop
# Single writer of the AVD + SDK caches: PR-written caches aren't visible to
# other PRs, so develop seeds them and the shards restore read-only.
seed-android-avd:
name: Seed Android AVD Cache
if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }}
runs-on: ubuntu-latest
env:
ANDROID_AVD_HOME: /home/runner/.android/avd
steps:
- name: Checkout Repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Java
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0
with:
distribution: temurin
java-version: 17
- name: Cache Android AVD
id: avd-cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ runner.os }}-api34
# The emulator + system image live outside ~/.android/avd — cache them
# separately so shards don't each re-download ~1 GB.
- name: Cache Android SDK packages (emulator + system image)
id: sdk-cache
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: |
/usr/local/lib/android/sdk/emulator
/usr/local/lib/android/sdk/system-images/android-34/google_apis/x86_64
key: android-sdk-emu-${{ runner.os }}-api34
# Retried install so a corrupt partial download self-heals
- name: Pre-install Android SDK packages (cache miss only)
if: steps.sdk-cache.outputs.cache-hit != 'true'
uses: ./.github/actions/preinstall-android-sdk
- name: Enable KVM group permissions
if: steps.avd-cache.outputs.cache-hit != 'true'
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Generate AVD snapshot (cache miss only)
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@e89f39f1abbbd05b1113a29cf4db69e7540cae5a # v2.37.0
timeout-minutes: 45
with:
api-level: 34
disk-size: 4096M
arch: x86_64
target: google_apis
profile: pixel_7_pro
cores: 4
ram-size: 6144M
force-avd-creation: true
disable-animations: true
emulator-boot-timeout: 900
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -accel on
script: echo "AVD snapshot generated for cache"