-
Notifications
You must be signed in to change notification settings - Fork 11
148 lines (125 loc) · 4.17 KB
/
build.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Build
on:
push:
branches:
- main
pull_request:
env:
SENTRY_ALLOW_FAILURE: true
MAESTRO_VERSION: 1.39.0
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-android:
name: Android
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache-dependency-path: package-lock.json
- run: npm ci
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- uses: gradle/gradle-build-action@v3
- working-directory: android
run: ./gradlew :app:assembleRelease
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: empower-plant-react-native-android
path: android/app/build/outputs/apk/release/app-release.apk
retention-days: 60
build-ios:
name: iOS
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache-dependency-path: package-lock.json
- run: npm ci
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.0'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- working-directory: ios
run: bundle exec pod install
- name: Run xcodebuild
working-directory: ios
run: |
mkdir -p "DerivedData"
derivedData="$(cd "DerivedData" ; pwd -P)"
set -o pipefail && xcodebuild \
-workspace sentry_react_native.xcworkspace \
-configuration "Release" \
-scheme sentry_react_native \
-destination 'generic/platform=iOS Simulator' \
-derivedDataPath "$derivedData" \
build \
| tee xcodebuild.log \
| xcbeautify --quieter --is-ci --disable-colored-output
- name: Upload APP
uses: actions/upload-artifact@v4
with:
name: empower-plant-react-native-ios
path: ios/DerivedData/Build/Products/Release-iphonesimulator/sentry_react_native.app
retention-days: 60
- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: build-ios-logs
path: ios/xcodebuild.log
run-ui-test-android:
name: UI Test Android
needs: build-android
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup KVM
shell: bash
run: |
# check if virtualization is supported...
sudo apt install -y --no-install-recommends cpu-checker coreutils && echo "CPUs=$(nproc --all)" && kvm-ok
# allow access to KVM to run the emulator
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: Download APK artifact
uses: actions/download-artifact@v4
with:
name: empower-plant-react-native-android
- name: Install Maestro
uses: dniHze/maestro-test-action@bda8a93211c86d0a05b7a4597c5ad134566fbde4 # pin@v1.0.0
with:
maestro-version: ${{env.MAESTRO_VERSION}}
- name: Run tests
uses: reactivecircus/android-emulator-runner@f0d1ed2dcad93c7479e8b2f2226c83af54494915 # pin@v2.32.0
with:
api-level: 30
force-avd-creation: false
disable-animations: true
disable-spellchecker: true
target: 'aosp_atd'
channel: canary # Necessary for ATDs
emulator-options: >
-no-window
-no-snapshot-save
-gpu swiftshader_indirect
-noaudio
-no-boot-anim
-camera-back none
-camera-front none
-timezone US/Pacific
script: |
adb install -r -d app-release.apk
maestro test maestro --debug-output maestro-logs --env=APP_ID=com.sentry_react_native