DRAFT: feat: setup GitHub actions fastlane #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E Test - Main PR | |
on: | |
pull_request: | |
branches: ['main'] | |
jobs: | |
test-android: | |
name: e2e-android-test | |
runs-on: macos-13 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v2 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
cache: 'yarn' | |
- name: Install React Native CLI | |
run: yarn global react-native-cli | |
- name: Install Dependencies | |
run: yarn bootstrap-no-pods | |
- name: Setup Java environment | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Gradle cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }} | |
- name: Install Maestro CLI | |
run: curl -Ls "https://get.maestro.mobile.dev" | bash | |
- name: Add Maestro to path | |
run: echo "${HOME}/.maestro/bin" >> $GITHUB_PATH | |
- name: Run Android Emulator and app | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 29 | |
arch: x86_64 | |
target: google_apis | |
force-avd-creation: false | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
disable-animations: true | |
script: | | |
yarn run-example-android | |
yarn test:e2e | |
test-ios: | |
name: e2e-ios-test | |
runs-on: macos-13 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v2 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- uses: actions/cache@v2 | |
with: | |
path: example/ios/Pods | |
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pods- | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22 | |
cache: 'yarn' | |
- name: Install React Native CLI | |
run: yarn global add react-native-cli | |
- name: Install Dependencies | |
run: yarn bootstrap | |
- name: Install Maestro CLI | |
run: | | |
curl -Ls "https://get.maestro.mobile.dev" | bash | |
brew tap facebook/fb | |
brew install facebook/fb/idb-companion | |
- name: Add Maestro to path | |
run: echo "${HOME}/.maestro/bin" >> $GITHUB_PATH | |
- name: Build iOS App | |
run: | | |
yarn run-example-ios | |
- name: Run tests | |
run: | | |
yarn test:e2e |