add react-native 0.73 support (#200) #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E tests on Expo Android project | |
on: | |
push: | |
branches: [main, '*-stable'] | |
paths: | |
- .github/workflows/expo-android.yml | |
- android/** | |
- src/v8runtime/** | |
- package.json | |
- yarn.lock | |
pull_request: | |
paths: | |
- .github/workflows/expo-android.yml | |
- android/** | |
- src/v8runtime/** | |
- package.json | |
- yarn.lock | |
jobs: | |
e2e-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: oven-sh/setup-bun@v1 | |
- name: Use JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Restore yarn caches | |
uses: actions/cache@v2 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-workspace-modules-${{ hashFiles('yarn.lock') }} | |
- name: Yarn install | |
run: yarn install --frozen-lockfile | |
- name: Generate TestApp | |
run: | | |
yarn create expo-app -t blank@@sdk-50 TestApp | |
cd TestApp | |
yarn add v8-android-jit | |
yarn add file:../react-native-v8 | |
jq '.expo.android.package = "com.testapp" | .expo.plugins += ["react-native-v8"] | .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 android | |
cd android | |
./gradlew :app:assembleRelease | |
- name: ⚙️ Enable KVM for Android virtualization | |
shell: bash | |
run: | | |
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: Run tests | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 33 | |
arch: x86_64 | |
target: google_apis | |
working-directory: ../TestApp/android | |
script: | | |
adb install -r app/build/outputs/apk/release/app-release.apk | |
adb logcat -c | |
adb shell am start -n com.testapp/com.testapp.MainActivity | |
sleep 20 | |
adb logcat -d > adb.log | |
grep -E "=== V8 version\[.+\] ===" adb.log > /dev/null | |
- name: Collect failure files | |
if: failure() | |
run: | | |
cp ../TestApp/android/adb.log . | |
- name: Upload failed artifacts | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts | |
path: | | |
adb.log |