-
Notifications
You must be signed in to change notification settings - Fork 4
130 lines (111 loc) · 4.89 KB
/
Copy pathandroid.yml
File metadata and controls
130 lines (111 loc) · 4.89 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Android CI
on:
push:
branches: [main, dev]
paths:
- packages/react-native/**
- packages/sdk-core/**
- examples/sdk/reactNative/**
- .github/workflows/android.yml
- .github/scripts/**
pull_request:
paths:
- packages/react-native/**
- packages/sdk-core/**
- examples/sdk/reactNative/**
- .github/workflows/android.yml
- .github/scripts/**
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
native_crash:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
api-level: [34]
arch: [x86_64]
new-arch: [true, false]
steps:
- uses: actions/checkout@v4
- name: Verify 16KB alignment
run: |
sudo apt-get install -y binutils
bash scripts/verify-elf-16k.sh
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
cache-dependency-path: |
package-lock.json
examples/sdk/reactNative/package-lock.json
- name: Use Java 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: gradle
- run: npm ci
- run: npm run build
- name: Install example dependencies
working-directory: examples/sdk/reactNative
# npm ci fails after an SDK version bump, the lock records the linked package's version.
run: npm install --no-audit --no-fund
- name: Inject the CI crash driver into the example entry point
run: cat .github/scripts/ci-crash-driver.js >> examples/sdk/reactNative/index.js
- name: Run SDK unit tests
working-directory: examples/sdk/reactNative/android
run: ./gradlew :backtrace_react-native:testDebugUnitTest -PnewArchEnabled=${{ matrix.new-arch }} --console=plain
- name: Build example app
working-directory: examples/sdk/reactNative/android
run: ./gradlew assembleRelease -PbtCiDebuggable -PnewArchEnabled=${{ matrix.new-arch }} -x uploadSourceMapsToBacktrace --console=plain
- name: Verify native libraries and JNI symbols
run: bash .github/scripts/verify-jni-symbols.sh examples/sdk/reactNative/android/app/build/outputs/apk/release/app-release.apk
- name: Enable KVM
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: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}-${{ matrix.arch }}
- name: Create AVD snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
target: google_apis
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Capture a native crash on the emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
target: google_apis
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: bash .github/scripts/android-native-crash.sh
- name: Upload crash evidence
if: failure()
uses: actions/upload-artifact@v4
with:
name: native-crash-api${{ matrix.api-level }}-${{ matrix.arch }}-newarch-${{ matrix.new-arch }}
path: |
/tmp/native-crash.dmp
/tmp/logcat.txt
if-no-files-found: warn
retention-days: 7