-
Notifications
You must be signed in to change notification settings - Fork 69
83 lines (72 loc) · 2.71 KB
/
expo-ios.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
name: E2E tests on Expo iOS project
on:
push:
branches: [main, '*-stable']
paths:
- .github/workflows/expo-ios.yml
- src/iosexecutor/**
- src/v8runtime/**
- package.json
- bun.lockb
pull_request:
paths:
- .github/workflows/expo-ios.yml
- src/iosexecutor/**
- src/v8runtime/**
- package.json
- bun.lockb
jobs:
e2e-test:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- name: 🔨 Switch to Xcode 15.4
run: sudo xcode-select --switch /Applications/Xcode_15.4.app
- name: Restore node_modules caches
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-workspace-modules-${{ hashFiles('bun.lockb') }}
- name: Bun install
run: bun install --frozen-lockfile
- name: Generate TestApp
run: |
bun link
bunx create-expo-app -t blank@@sdk-51 TestApp
cd TestApp
bun add v8-ios
bun link react-native-v8 --save
jq '.expo.ios.bundleIdentifier = "com.testapp" | .expo.plugins += [["react-native-v8", {"ios":true}]] | .expo.jsEngine = "jsc"' app.json > app.json.tmp && mv -f app.json.tmp app.json
echo 'if (global._v8runtime) { console.log(`=== V8 version[${global._v8runtime().version}] ===`); }' >> App.js
working-directory: ..
- name: Build TestApp
working-directory: ../TestApp
run: |
npx expo prebuild -p ios
cd ios
xcodebuild -workspace ./TestApp.xcworkspace -scheme TestApp -configuration Release -derivedDataPath ./build -destination 'generic/platform=iOS Simulator' build | xcpretty
- name: Run TestApp
working-directory: ../TestApp/ios
run: |
SIMUDID=$(xcrun simctl list devices available -j | jq -r '.devices."com.apple.CoreSimulator.SimRuntime.iOS-17-5"[] | select(.name=="iPhone 15 Pro") | .udid')
echo "Using simulator udid[${SIMUDID}]"
xcrun simctl boot ${SIMUDID}
xcrun simctl install booted ./build/Build/Products/Release-iphonesimulator/TestApp.app
xcrun simctl spawn booted log stream --predicate 'process == "TestApp"' --level=debug > sim.log &
LOG_PID=$!
xcrun simctl launch booted com.testapp
sleep 5
kill -SIGINT $LOG_PID
grep -E "=== V8 version\[.+\] ===" sim.log > /dev/null
- name: Collect failure files
if: failure()
run: |
cp ../TestApp/ios/sim.log .
- name: Upload failed artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
sim.log