Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,94 +234,98 @@
env:
MOCHA_REMOTE_CONTEXT: allTests
test-android:
if: github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Android 🤖')
# Temporarily gated to labeled PRs only: the ubuntu-self-hosted runner is
# offline, so running this on main pushes leaves the job queued forever and
# blocks the whole Check run from completing. Re-enable on main once the
# self-hosted runner is back. Tracked in #379.
if: contains(github.event.pull_request.labels.*.name, 'Android 🤖')
name: Test app (Android)
runs-on: ubuntu-self-hosted
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v6
with:
node-version: lts/krypton
- name: Setup cpp tools
uses: aminya/setup-cpp@v1
with:
clang-format: true
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}-${{ runner.os }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
packages: tools platform-tools ndk;${{ env.NDK_VERSION }} cmake;${{ env.CMAKE_VERSION }}
- run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android aarch64-apple-ios-sim
- run: npm ci
- run: npm run bootstrap
env:
CMAKE_RN_TRIPLETS: x86_64-linux-android
FERRIC_TARGETS: x86_64-linux-android
- name: Clone patched Hermes version
shell: bash
run: |
REACT_NATIVE_OVERRIDE_HERMES_DIR=$(npx react-native-node-api vendor-hermes --silent)
echo "REACT_NATIVE_OVERRIDE_HERMES_DIR=$REACT_NATIVE_OVERRIDE_HERMES_DIR" >> $GITHUB_ENV
working-directory: apps/test-app
# - name: Setup Android Emulator cache
# uses: actions/cache@v4
# id: avd-cache
# with:
# path: |
# ~/.android/avd/*
# ~/.android/adb*
# key: ${{ runner.os }}-avd-29
# See https://github.com/marketplace/actions/android-emulator-runner#running-hardware-accelerated-emulators-on-linux-runners
- name: Enable KVM group perms
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: Build weak-node-api for all Android architectures
run: npm run prebuild:build:android --workspace weak-node-api
- name: Build ferric-example for all architectures
run: npm run build -- --android
working-directory: packages/ferric-example
- name: Run tests (Android)
timeout-minutes: 75
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
force-avd-creation: false
disable-animations: true
arch: x86_64
ndk: ${{ env.NDK_VERSION }}
cmake: 3.22.1
working-directory: apps/test-app
script: |
# Setup port forwarding to Mocha Remote
adb reverse tcp:8090 tcp:8090
# Uninstall the app if already in the snapshot (unlikely but could result in a signature mismatch failure)
adb uninstall com.microsoft.reacttestapp || true
# Start logcat in background and save logs
adb logcat > emulator-logcat.txt 2>&1 &
LOGCAT_PID=$!
# Build, install and run the app
npm run test:android:allTests -- --mode Release
# Wait a bit for the sub-process to terminate, before terminating the emulator
sleep 5
# Stop logcat
kill $LOGCAT_PID || true
- name: Upload device logs
if: always()
uses: actions/upload-artifact@v4
with:
name: emulator-logcat
path: apps/test-app/emulator-logcat.txt
test-ferric-apple-triplets:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
if: github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Ferric 🦀')
name: Test ferric Apple triplets
runs-on: macos-latest
Expand Down
Loading