Skip to content

[UPD] TESTS - github action - Try to reduce metamemary by limiting th… #4

[UPD] TESTS - github action - Try to reduce metamemary by limiting th…

[UPD] TESTS - github action - Try to reduce metamemary by limiting th… #4

Workflow file for this run

name: 🎭 E2E Tests
env:
EXPO_PUBLIC_API_URL: ${{ vars.API_URL }}
EXPO_PUBLIC_AUTH_URL: ${{ vars.AUTH_URL }}
EXPO_PUBLIC_OPENAPI_URL: ${{ vars.OPENAPI_URL }}
on:
workflow_dispatch:
push:
branches: [test/e2e, test/e2e/**]
pull_request:
types: [closed]
branches: [main]
jobs:
e2e-smoke:
name: πŸ’¨ Smoke Tests
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: πŸ— Setup repo
uses: actions/checkout@v4
- name: πŸ— Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: πŸ— Setup Node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'
- name: πŸ— Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: πŸ— Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: πŸ“¦ Install dependencies
run: pnpm install
- name: πŸ”¨ Build APK (local)
run: eas build --profile e2e --platform android --non-interactive --local --output build.apk
env:
APP_ENV: development
ORG_GRADLE_PROJECT_reactNativeArchitectures: x86_64
- name: 🎭 Install Maestro
run: curl -Ls "https://get.maestro.mobile.dev" | bash && echo "$HOME/.maestro/bin" >> $GITHUB_PATH
- name: πŸ€– Run smoke tests on emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
arch: x86_64
script: |
adb install build.apk
pnpm test:e2e:smoke
e2e-full:
name: 🎭 Full E2E Tests
if: (github.event_name == 'pull_request' && github.event.pull_request.merged == true) || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: πŸ— Setup repo
uses: actions/checkout@v4
- name: πŸ— Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: πŸ— Setup Node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm'
- name: πŸ— Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
- name: πŸ— Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: πŸ“¦ Install dependencies
run: pnpm install
- name: πŸ”¨ Build APK (local)
run: eas build --profile e2e --platform android --non-interactive --local --output build.apk
env:
APP_ENV: development
ORG_GRADLE_PROJECT_reactNativeArchitectures: x86_64
- name: 🎭 Install Maestro
run: curl -Ls "https://get.maestro.mobile.dev" | bash && echo "$HOME/.maestro/bin" >> $GITHUB_PATH
- name: πŸ€– Run full E2E tests on emulator
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
arch: x86_64
script: |
adb install build.apk
pnpm test:e2e