-
-
Notifications
You must be signed in to change notification settings - Fork 337
115 lines (102 loc) · 3.18 KB
/
native-tests.yml
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
name: Native Tests
on:
push:
branches: [main]
pull_request:
jobs:
cancel-previous-workflow:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected]
with:
access_token: ${{ github.token }}
test-ios:
name: ios
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: NPM cache
uses: actions/cache@v3
id: deps-cache
with:
path: node_modules
key: ${{ github.workflow }}-${{ github.job }}-npm-${{ hashFiles('yarn.lock') }}
- name: Install SDK JS Dependencies
if: steps.deps-cache.outputs['cache-hit'] != 'true'
run: yarn install
- name: Install App Pods
working-directory: RNSentryCocoaTester
run: pod install
- name: Run iOS Tests
working-directory: RNSentryCocoaTester
env:
SCHEME: RNSentryCocoaTester
CONFIGURATION: Release
DESTINATION: 'platform=iOS Simulator,OS=latest,name=iPhone 14'
run: |
env NSUnbufferedIO=YES \
xcodebuild -workspace *.xcworkspace \
-scheme $SCHEME -configuration $CONFIGURATION \
-destination "$DESTINATION" \
test
test-android:
name: android
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Gradle cache
uses: gradle/gradle-build-action@v2
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-21
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b #[email protected]
with:
api-level: 21
emulator-options: >
-accel on
-no-window
-gpu swiftshader_indirect
-noaudio
-no-boot-anim
-camera-back none
-camera-front none
-timezone US/Pacific
force-avd-creation: false
disable-animations: true
arch: x86_64
profile: Nexus 6
script: echo "Generated AVD snapshot for caching."
- name: Run connected tests
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b #[email protected]
with:
working-directory: RNSentryAndroidTester
api-level: 21
emulator-options: >
-no-snapshot-save
-accel on
-no-window
-gpu swiftshader_indirect
-noaudio
-no-boot-anim
-camera-back none
-camera-front none
-timezone US/Pacific
force-avd-creation: false
disable-animations: true
arch: x86_64
profile: Nexus 6
script: |
./gradlew uninstallDebug uninstallDebugAndroidTest
./gradlew connectedCheck