Repository navigation
127 lines (119 loc) · 4.26 KB
/
Copy pathreact_native.yml
File metadata and controls
127 lines (119 loc) · 4.26 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
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# The React Native package (bindings/react_native/): type checks and unit
# tests, then the example app built from the packed tarball on Android and
# iOS. On iOS the app also runs in the simulator under a Maestro smoke test.
name: React Native
on:
push:
branches: [main]
paths:
- "bindings/react_native/**"
- "client/android/compose/sdk/**"
- "client/ios/swiftui/sdk/**"
- ".github/workflows/react_native.yml"
pull_request:
paths:
- "bindings/react_native/**"
- "client/android/compose/sdk/**"
- "client/ios/swiftui/sdk/**"
- ".github/workflows/react_native.yml"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: react-native-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
working-directory: bindings/react_native
jobs:
js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install --no-audit --no-fund
- run: npm run typecheck
- run: npm test
android:
needs: js
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Stage the Aether Android SDK
run: python3 scripts/stage_native_sdk.py --platform android --build
- name: Pack the package
run: |
npm install --no-audit --no-fund
npm pack
- name: Create the example app
run: example/setup.sh aetherux-react-native-*.tgz
- name: Build the example app
working-directory: bindings/react_native/example/app/android
run: ./gradlew --no-daemon assembleRelease
ios:
needs: js
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Stage the Aether iOS SDK
run: python3 scripts/stage_native_sdk.py --platform ios --build
- name: Pack the package
run: |
npm install --no-audit --no-fund
npm pack
- name: Create the example app
run: example/setup.sh aetherux-react-native-*.tgz
- name: Install pods
working-directory: bindings/react_native/example/app/ios
run: |
bundle install
bundle exec pod install
# Release bundles the JavaScript, so the app runs without Metro. The core
# library's simulator slice is arm64 only.
- name: Build the example app
working-directory: bindings/react_native/example/app/ios
run: |
xcodebuild \
-workspace AetherExample.xcworkspace \
-scheme AetherExample \
-configuration Release \
-sdk iphonesimulator \
-destination 'generic/platform=iOS Simulator' \
-derivedDataPath build \
ARCHS=arm64 ONLY_ACTIVE_ARCH=YES \
build
- name: Run the smoke test
run: |
curl -fsSL "https://get.maestro.mobile.dev" | bash
export PATH="$HOME/.maestro/bin:$PATH"
device=$(xcrun simctl list devices available -j \
| python3 -c 'import json,sys; d=json.load(sys.stdin)["devices"]; print(next(x["udid"] for r in d for x in d[r] if r.startswith("com.apple.CoreSimulator.SimRuntime.iOS") and x["name"].startswith("iPhone")))')
xcrun simctl boot "$device"
xcrun simctl bootstatus "$device"
xcrun simctl install "$device" example/app/ios/build/Build/Products/Release-iphonesimulator/AetherExample.app
maestro --device "$device" test example/smoke.yaml