Skip to content

Commit 9317f66

Browse files
committed
fix ci
1 parent c41e828 commit 9317f66

2 files changed

Lines changed: 7 additions & 152 deletions

File tree

.github/workflows/e2e_android.yml

Lines changed: 4 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,7 @@ on:
1616
- 'scripts/**'
1717
- 'android/**'
1818
- 'cpp/**'
19-
- 'Example/e2etest/package.json'
20-
- 'Example/e2etest/bun.lock'
21-
- 'Example/e2etest/app.json'
22-
- 'Example/e2etest/update.json'
23-
- 'Example/e2etest/.detoxrc.js'
24-
- 'Example/e2etest/.detoxrc.ts'
25-
- 'Example/e2etest/babel.config.js'
26-
- 'Example/e2etest/metro.config.js'
27-
- 'Example/e2etest/index.js'
28-
- 'Example/e2etest/tsconfig*.json'
29-
- 'Example/e2etest/src/**'
30-
- 'Example/e2etest/e2e/**'
31-
- 'Example/e2etest/scripts/**'
32-
- 'Example/e2etest/android/**'
19+
- 'Example/e2etest/**'
3320
push:
3421
branches:
3522
- master
@@ -46,20 +33,7 @@ on:
4633
- 'scripts/**'
4734
- 'android/**'
4835
- 'cpp/**'
49-
- 'Example/e2etest/package.json'
50-
- 'Example/e2etest/bun.lock'
51-
- 'Example/e2etest/app.json'
52-
- 'Example/e2etest/update.json'
53-
- 'Example/e2etest/.detoxrc.js'
54-
- 'Example/e2etest/.detoxrc.ts'
55-
- 'Example/e2etest/babel.config.js'
56-
- 'Example/e2etest/metro.config.js'
57-
- 'Example/e2etest/index.js'
58-
- 'Example/e2etest/tsconfig*.json'
59-
- 'Example/e2etest/src/**'
60-
- 'Example/e2etest/e2e/**'
61-
- 'Example/e2etest/scripts/**'
62-
- 'Example/e2etest/android/**'
36+
- 'Example/e2etest/**'
6337

6438
concurrency:
6539
group: ${{ github.workflow }}-${{ github.ref }}
@@ -84,15 +58,15 @@ jobs:
8458
- name: Setup Node.js
8559
uses: actions/setup-node@v6
8660
with:
87-
node-version: 22
61+
node-version: 24
8862

8963
- name: Setup Bun
9064
uses: oven-sh/setup-bun@v2
9165
with:
9266
bun-version: latest
9367

9468
- name: Cache Bun dependencies
95-
uses: actions/cache@v5.0.4
69+
uses: actions/cache@v5
9670
with:
9771
path: ~/.bun/install/cache
9872
key: ${{ runner.os }}-bun-e2e-${{ hashFiles('Example/e2etest/bun.lock', 'react-native-update-cli/bun.lock') }}
@@ -170,122 +144,3 @@ jobs:
170144
path: Example/e2etest/artifacts
171145
if-no-files-found: ignore
172146
retention-days: 7
173-
174-
e2e-android-arm:
175-
runs-on: ubuntu-24.04-arm
176-
timeout-minutes: 30
177-
continue-on-error: true
178-
steps:
179-
- name: Checkout react-native-update
180-
uses: actions/checkout@v6
181-
with:
182-
submodules: recursive
183-
184-
- name: Checkout react-native-update-cli
185-
uses: actions/checkout@v6
186-
with:
187-
repository: reactnativecn/react-native-update-cli
188-
path: react-native-update-cli
189-
190-
- name: Setup Node.js
191-
uses: actions/setup-node@v6
192-
with:
193-
node-version: 22
194-
195-
- name: Setup Bun
196-
uses: oven-sh/setup-bun@v2
197-
with:
198-
bun-version: latest
199-
200-
- name: Cache Bun dependencies
201-
uses: actions/cache@v5.0.4
202-
with:
203-
path: ~/.bun/install/cache
204-
key: ${{ runner.os }}-${{ runner.arch }}-bun-e2e-${{ hashFiles('Example/e2etest/bun.lock', 'react-native-update-cli/bun.lock') }}
205-
restore-keys: |
206-
${{ runner.os }}-${{ runner.arch }}-bun-e2e-
207-
208-
- name: Setup Java
209-
uses: actions/setup-java@v5
210-
with:
211-
distribution: temurin
212-
java-version: '17'
213-
cache: gradle
214-
cache-dependency-path: |
215-
Example/e2etest/bun.lock
216-
Example/e2etest/android/*.gradle
217-
Example/e2etest/android/**/*.gradle
218-
Example/e2etest/android/gradle/wrapper/gradle-wrapper.properties
219-
220-
- name: Setup Android SDK
221-
uses: android-actions/setup-android@v4.0.1
222-
with:
223-
packages: |
224-
tools
225-
platform-tools
226-
platforms;android-36
227-
build-tools;36.0.0
228-
ndk;27.1.12297006
229-
230-
- name: Enable KVM if available
231-
run: |
232-
if [ -e /dev/kvm ]; then
233-
sudo chmod 666 /dev/kvm
234-
ls -l /dev/kvm
235-
else
236-
echo "/dev/kvm is not available on this ARM runner."
237-
fi
238-
239-
- name: Install e2etest dependencies
240-
run: cd Example/e2etest && bun install --frozen-lockfile
241-
242-
- name: Link local react-native-update
243-
run: |
244-
set -euo pipefail
245-
export LOCAL_RNU_VERSION="$(node -p "require('./Example/e2etest/node_modules/react-native-update/package.json').version")"
246-
LOCAL_RNU_DIR="$PWD/Example/e2etest/.e2e-artifacts/local-react-native-update"
247-
rm -rf "$LOCAL_RNU_DIR" Example/e2etest/node_modules/react-native-update
248-
mkdir -p "$LOCAL_RNU_DIR"
249-
cp package.json react-native-update.podspec react-native.config.js expo-module.config.json "$LOCAL_RNU_DIR"/
250-
rsync -a --exclude='.git' src ios android cpp scripts "$LOCAL_RNU_DIR"/
251-
node -e "const fs = require('fs'); const file = 'Example/e2etest/.e2e-artifacts/local-react-native-update/package.json'; const pkg = JSON.parse(fs.readFileSync(file, 'utf8')); pkg.version = process.env.LOCAL_RNU_VERSION; fs.writeFileSync(file, JSON.stringify(pkg, null, 2) + '\n');"
252-
ln -s ../.e2e-artifacts/local-react-native-update Example/e2etest/node_modules/react-native-update
253-
254-
- name: Install react-native-update-cli dependencies
255-
run: cd react-native-update-cli && bun install --frozen-lockfile && bun run build
256-
257-
- name: Detox build (android.emu.release arm64)
258-
env:
259-
DETOX_ANDROID_ARCHS: arm64-v8a
260-
DETOX_AVD_NAME: api34-arm64
261-
run: cd Example/e2etest && E2E_PLATFORM=android bunx detox build --configuration android.emu.release
262-
263-
- name: Prepare local update artifacts
264-
env:
265-
E2E_PLATFORM: android
266-
RNU_CLI_ROOT: ${{ github.workspace }}/react-native-update-cli
267-
run: cd Example/e2etest && bun run prepare:e2e
268-
269-
- name: Detox test (android.emu.release arm64)
270-
uses: reactivecircus/android-emulator-runner@v2
271-
env:
272-
DETOX_ANDROID_ARCHS: arm64-v8a
273-
RNU_CLI_ROOT: ${{ github.workspace }}/react-native-update-cli
274-
RNU_E2E_SKIP_PREPARE: 'true'
275-
DETOX_AVD_NAME: api34-arm64
276-
with:
277-
api-level: 34
278-
target: google_apis
279-
arch: arm64-v8a
280-
avd-name: api34-arm64
281-
emulator-boot-timeout: 900
282-
script: cd Example/e2etest && E2E_PLATFORM=android bunx detox test --configuration android.emu.release --headless --record-logs all --retries 1
283-
284-
- name: Upload Detox artifacts
285-
if: failure()
286-
uses: actions/upload-artifact@v7.0.1
287-
with:
288-
name: e2e-android-arm-detox-artifacts
289-
path: Example/e2etest/artifacts
290-
if-no-files-found: ignore
291-
retention-days: 7

Example/e2etest/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ detox build --configuration android.emu.release
2323
E2E_PLATFORM=android detox test --configuration android.emu.release --headless --record-logs all
2424
```
2525

26-
架构需要跟 AVD 保持一致:Apple Silicon 本地的 `api34` AVD 和 ARM CI
27-
comparison job 用 `arm64-v8a`;GitHub `ubuntu-latest` x64 job 用
28-
`x86_64` emulator 和 `DETOX_ANDROID_ARCHS=x86_64`
26+
架构需要跟 AVD 保持一致:Apple Silicon 本地的 `api34` AVD
27+
`arm64-v8a`;GitHub `ubuntu-latest` x64 job 用 `x86_64` emulator 和
28+
`DETOX_ANDROID_ARCHS=x86_64`

0 commit comments

Comments
 (0)