Skip to content

Commit

Permalink
fix: iOS action
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrauber committed Sep 12, 2024
1 parent bd5f257 commit 60f107a
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 82 deletions.
129 changes: 65 additions & 64 deletions .github/workflows/android-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
MAESTRO_VERSION: 1.30.4

jobs:
run_android_e2e:
android-actions:
timeout-minutes: 30
runs-on: macos-latest

Expand Down Expand Up @@ -87,66 +87,67 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node ${{ inputs.NVMRC }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.NVMRC }}

- name: Setup JDK zulu 17
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"

- name: Install Maestro
run: curl -Ls 'https://get.maestro.mobile.dev' | bash

- name: Enable Corepack
run: corepack enable

- run: yarn install --immutable --check-cache
working-directory: packages/react-native-app

- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
working-directory: packages/react-native-app/android
script: ./gradlew assemble

- name: Run Maestro E2E tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
cores: 2
ram-size: 2048M
force-avd-creation: false
emulator-boot-timeout: 600 # 10min
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
pre-emulator-launch-script: |
echo "Running pre emulator launch script. Printing the working directory now:"
pwd
script: |
npx envinfo # check memory usage
adb devices # verify emulator is running
adb install app-release.apk # install app
# Run e2e
./run_android_e2e.sh
# ^^^ Will debug files: report*.xml, video_record.mp4, last_img.png
- name: Upload report
if: always()
uses: actions/upload-artifact@v3
with:
name: E2E Report (${{ matrix.arch }}, ${{ matrix.api-level }}, ${{ matrix.target }})
path: |
${{ github.workspace }}/*.mp4
${{ github.workspace }}/*.png
${{ github.workspace }}/report*.xml
~/.maestro/tests/**/*
# - name: Setup node ${{ inputs.NVMRC }}
# uses: actions/setup-node@v4
# with:
# node-version: ${{ inputs.NVMRC }}
# cache: "yarn"

# - name: Setup JDK zulu 17
# uses: actions/setup-java@v4
# with:
# distribution: "zulu"
# java-version: "17"

# - name: Install Maestro
# run: curl -Ls 'https://get.maestro.mobile.dev' | bash

# - name: Enable Corepack
# run: corepack enable

# - run: yarn install --immutable --check-cache
# working-directory: packages/react-native-app

# - name: run tests
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: 29
# working-directory: packages/react-native-app/android
# script: ./gradlew assemble

# - name: Run Maestro E2E tests
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: ${{ matrix.api-level }}
# target: ${{ matrix.target }}
# arch: ${{ matrix.arch }}
# cores: 2
# ram-size: 2048M
# force-avd-creation: false
# emulator-boot-timeout: 600 # 10min
# emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
# disable-animations: true
# pre-emulator-launch-script: |
# echo "Running pre emulator launch script. Printing the working directory now:"
# pwd
# script: |
# npx envinfo # check memory usage

# adb devices # verify emulator is running

# adb install app-release.apk # install app

# # Run e2e
# ./run_android_e2e.sh
# # ^^^ Will debug files: report*.xml, video_record.mp4, last_img.png

# - name: Upload report
# if: always()
# uses: actions/upload-artifact@v3
# with:
# name: E2E Report (${{ matrix.arch }}, ${{ matrix.api-level }}, ${{ matrix.target }})
# path: |
# ${{ github.workspace }}/*.mp4
# ${{ github.workspace }}/*.png
# ${{ github.workspace }}/report*.xml
# ~/.maestro/tests/**/*
49 changes: 31 additions & 18 deletions .github/workflows/ios-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
type: string

jobs:
build:
ios-actions:
runs-on: macos-latest
timeout-minutes: 45 # Figure out why this job can be super slow; runner hardware?
timeout-minutes: 45
env:
XC_SIMULATOR_NAME: iPhone 15

Expand All @@ -27,23 +27,36 @@ jobs:
with:
node-version: ${{ inputs.NVMRC }}

# - name: Enable Corepack
# run: corepack enable
- name: Enable Corepack
run: corepack enable

# - name: Install Yarn Dependencies
# run: yarn install --immutable --check-cache
- name: Install Yarn Dependencies
run: yarn install --immutable --check-cache

# - name: Install Pod Dependencies
# run: cd ios && pod --version && pod install
- name: Install Pod Dependencies
run: cd ios && pod --version && pod install

# - uses: futureware-tech/simulator-action@v3
# with:
# model: "iPhone 15"
- uses: futureware-tech/simulator-action@v3
with:
model: ${{ env.XC_SIMULATOR_NAME }}

# - uses: dniHze/maestro-test-action@v1
# with:
# flow: .maestro
# report: report.xml
# env:
# MAESTRO_CLI_NO_ANALYTICS: true
# MAESTRO_DRIVER_STARTUP_TIMEOUT: 60000
- name: Build and Install React Native iOS App
uses: sparkfabrik/[email protected]
with:
project-path: ios/RNMaplibreExample.xcodeproj
workspace-path: ios/RNMaplibreExample.xcworkspace
scheme: RNMaplibreExample
configuration: Release
export-method: development
output-path: RNMaplibreExample.ipa
build-pods: true
# pods-path: Podfile

- uses: dniHze/maestro-test-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAESTRO_CLI_NO_ANALYTICS: true
MAESTRO_DRIVER_STARTUP_TIMEOUT: 60000
with:
flow: .maestro
report: report.xml

0 comments on commit 60f107a

Please sign in to comment.