Skip to content

Commit

Permalink
try out with android ci
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Feb 14, 2024
1 parent d74aa54 commit 1c0304d
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/e2e-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# .github/workflows/e2e-android.yml
name: e2e-android
on: push

jobs:
e2e-android:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
cache: yarn
node-version-file: .node-version

- name: Install Yarn dependencies
run: yarn --frozen-lockfile --prefer-offline

- name: Setup Java
uses: actions/setup-java@v3
with:
cache: gradle
distribution: temurin
java-version: 17

- name: Cache Detox build
id: cache-detox-build
uses: actions/cache@v3
with:
path: test/android/app/build
key: ${{ runner.os }}-detox-build
restore-keys: |
${{ runner.os }}-detox-build
- name: Detox build
run: yarn detox build --configuration android.emu.release

- name: Get device name
id: device
run: node -e "console.log('AVD_NAME=' + require('./.detoxrc').devices.emulator.device.avdName)" >> $GITHUB_OUTPUT

- name: Detox test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 31
arch: x86_64
avd-name: ${{ steps.device.outputs.AVD_NAME }}
script: yarn detox test --configuration android.emu.debug --headless --record-logs all

- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: detox-artifacts
path: artifacts
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ test/yarn.lock

test/output
test/Gemfile.lock

test/android/.gradle

0 comments on commit 1c0304d

Please sign in to comment.