-
Notifications
You must be signed in to change notification settings - Fork 585
129 lines (116 loc) · 4.8 KB
/
install-test-react-native.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
name: Install test (React Native)
on:
# Every monday at 7:00 CET
schedule:
- cron: "0 6 * * 1"
# You can also activate this workflow manually from the Actions tab
workflow_dispatch:
defaults:
run:
working-directory: install-tests/react-native
jobs:
install:
name: Install Test on React Native ${{ matrix.platform == 'ios' && 'iOS' || 'Android' }} realm@${{ matrix.realm-version }}, react-native@${{ matrix.react-native-version }} new architecture ${{ matrix.new-architecture && 'enabled' || 'disabled' }} running ${{ matrix.engine }}
runs-on: ${{ matrix.platform == 'ios' && 'macos-13-xlarge' || 'macos-13-large' }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
platform:
#- ios
- android
realm-version:
#- v11 # Enable if we feel the need
- latest
#- next
react-native-version:
#- latest
- next
# - nightly # Enable if it's not too noizy
new-architecture:
#- true
- false
engine:
#- jsc
- hermes
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode
xcode:
- 15.0
#- 13.1
node:
# RN bumped minimum Node version: https://github.com/huntie/react-native/blob/6cb6b81dd1c6b74a0f4bac5b06fa5aef93b48fe4/CHANGELOG.md?plain=1#L15
- 18
# env:
# DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: install-test-${{ matrix.platform }}-r@${{ matrix.realm-version }}-rn@${{ matrix.react-native-version }}-${{ matrix.new-architecture && 'new' || 'old' }}-arch
max-size: '2.0G'
- name: Prepend ccache executables to the PATH
run: echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
- name: Configure ccache
run: ccache --set-config="compiler_check=content"
# TODO: Remove if this becomes unneeded in the future
- uses: futureware-tech/simulator-action@v2
if: ${{ matrix.platform == 'ios' }}
with:
model: "iPhone 14"
# - name: Invoke the simulator (making subsequent "open -a Simulator" calls work)
# if: ${{ matrix.platform == 'ios' }}
# run: open -a /Applications/Xcode_${{ matrix.xcode }}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator
- name: Install dependencies of the CLI
run: npm ci
- name: Initialize app
# Using "--skip-bundle-install" to let the setup-ruby action install the bundle
# Using "--skip-pod-install" to ensure it happens after setup-ruby has executed
run: npm run init -- --skip-bundle-install --skip-pod-install --realm-version ${{ matrix.realm-version }} --react-native-version ${{ matrix.react-native-version }} --engine ${{ matrix.engine }} --new-architecture ${{ matrix.new-architecture }}
# - uses: ruby/setup-ruby@v1
# if: ${{ matrix.platform == 'ios' }}
# with:
# ruby-version: '3.0'
# bundler-cache: true
# working-directory: install-tests/react-native/app
- if: ${{ matrix.platform == 'ios' }}
run: pod install
working-directory: install-tests/react-native/app/ios
- uses: actions/setup-java@v3
if: ${{ matrix.platform == 'android' }}
with:
distribution: 'zulu'
java-version: '17'
- name: Run test (iOS)
if: ${{ matrix.platform == 'ios' }}
run: npm test -- --platform ios
- name: Run test (Android)
if: ${{ matrix.platform == 'android' }}
uses: reactivecircus/android-emulator-runner@v2
timeout-minutes: 30
with:
api-level: 29
target: google_apis
script: npm test -- --platform android
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
working-directory: install-tests/react-native
slack-workflow-status:
if: always()
name: Post Workflow Status To Slack
needs: install
runs-on: ubuntu-latest
permissions:
actions: 'read'
steps:
- name: Slack Workflow Notification
uses: Gamesight/slack-workflow-status@master
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
# Post only to the #realm-js-team Slack channel in case of a scheduled run (realm-js-bot-tests otherwise)
slack_webhook_url: ${{ github.event.schedule && secrets.SLACK_TEAM_WEBHOOK || secrets.SLACK_TEST_WEBHOOK }}
include_jobs: true
include_commit_message: false