Skip to content

Instantly share code, notes, and snippets.

@kelseybrennan12
Created August 20, 2024 20:39
Show Gist options
  • Save kelseybrennan12/aedce1fd13d6c2ae6e0ef9bd973d8499 to your computer and use it in GitHub Desktop.
Save kelseybrennan12/aedce1fd13d6c2ae6e0ef9bd973d8499 to your computer and use it in GitHub Desktop.
Run Detox tests
name: Run Detox Tests
on: [pull_request]
jobs:
build-and-test-ios:
name: iOS - Build and run Detox tests
runs-on: macos-13-xlarge
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.2.0
- name: Npm install
run: npm install
- name: Pod install
run: cd ios && pod install
- name: Build Detox
run: npm run detox:ios:build
- name: Start Metro Server
run: npm run detox:start &
- name: Install Applesimutils
run: |
brew tap wix/brew
brew install applesimutils
- name: Run Detox tests
run: npm run detox:ios:test:ci
- name: Upload Test Artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: detox-ios-artifacts
path: artifacts
retention-days: 5
build-and-test-android:
name: Android - Build and run Detox tests
runs-on: ubuntu-latest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: false
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22.2.0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
- name: Npm install
run: npm install
- name: Build Detox
run: npm run detox:android:build
- name: Start Metro Server
run: npm run detox:start &
- name: Run Detox tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 31
arch: x86_64
avd-name: Android_API31
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-metrics
disable-animations: false
script: npm run detox:android:test:ci
- name: Upload Test Artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: detox-android-artifacts
path: artifacts
retention-days: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment