Skip to content

Commit 1396cec

Browse files
authored
Github action to trigger native crashes (#935)
1 parent d75ff5e commit 1396cec

File tree

2 files changed

+76
-1
lines changed

2 files changed

+76
-1
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Gradle Test App Random Native Crashes
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
iterations:
7+
description: Total number of random native crash iterations
8+
required: false
9+
default: '5000'
10+
type: string
11+
12+
jobs:
13+
run_random_native_crashes:
14+
runs-on: ubuntu-latest-8-cores
15+
env:
16+
SKIP_PROTO_GEN: 1
17+
steps:
18+
- name: Checkout project sources
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Android cmd line tools + NDK
22+
uses: ./.github/actions/common-android-setup
23+
with:
24+
setup-emulator: 'true'
25+
26+
- name: AVD cache
27+
uses: actions/cache@v4
28+
id: avd-cache
29+
with:
30+
path: |
31+
~/.android/avd/*
32+
~/.android/adb*
33+
key: ${{ runner.os }}-avd-api-23-random-native-crashes-v1
34+
35+
- name: Create AVD and generate snapshot for caching
36+
if: steps.avd-cache.outputs.cache-hit != 'true'
37+
timeout-minutes: 30
38+
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b
39+
with:
40+
channel: stable
41+
force-avd-creation: false
42+
api-level: 23
43+
target: default
44+
ram-size: 2048M
45+
arch: x86_64
46+
disk-size: 6144M
47+
profile: Nexus 6
48+
disable-animations: true
49+
emulator-options: -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
50+
script: echo "Generated AVD snapshot for caching."
51+
52+
- name: Run random native crashes
53+
timeout-minutes: 360
54+
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b
55+
with:
56+
channel: stable
57+
force-avd-creation: false
58+
api-level: 23
59+
target: default
60+
ram-size: 2048M
61+
arch: x86_64
62+
disk-size: 6144M
63+
profile: Nexus 6
64+
disable-animations: true
65+
emulator-options: -no-snapshot-save -no-window -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
66+
script: |
67+
ITERATIONS="${{ github.event.inputs.iterations || '5000' }}"
68+
if ! [[ "$ITERATIONS" =~ ^[0-9]+$ ]] || [[ "$ITERATIONS" -lt 1 ]]; then
69+
echo "iterations must be a positive integer"
70+
exit 1
71+
fi
72+
curl -Ls "https://get.maestro.mobile.dev" | bash
73+
export PATH="$PATH:$HOME/.maestro/bin"
74+
./tools/android_sdk_wrapper.sh platform/jvm/gradlew -Prust-target=x86_64 -p platform/jvm gradle-test-app:assembleDebug gradle-test-app:installDebug --stacktrace
75+
ITERATIONS="$ITERATIONS" maestro test tools/maestro/native-crash-loop.yaml

tools/maestro/native-crash-loop.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
appId: io.bitdrift.gradletestapp
22
---
33
- repeat:
4-
times: 50
4+
times: ${ITERATIONS}
55
commands:
66
- launchApp
77
- tapOn: "App Exits"

0 commit comments

Comments
 (0)