key var #46
Workflow file for this run
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 tests (ios) | ||
# Android + iOS maestro tests by environment | ||
# PR flow that includes all testing + build in a different step from maestro | ||
# Cache pods | ||
on: | ||
workflow_dispatch: | ||
push: | ||
env: | ||
APP_PATH: ./examples/Rn071/ios/DerivedData/Build/Products/Release-iphonesimulator/Rn071.app | ||
PROJECT_NAME: Rn071 | ||
EXAMPLE_SRC: ./examples/Rn071/src/** | ||
jobs: | ||
build-ios: | ||
name: Build | ||
runs-on: macos-13 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
id: cache | ||
env: | ||
KEY: ${{ hashFiles(format('src/**', 'ios/**', ${{ env.EXAMPLE_SRC }} )) }} | ||
Check failure on line 27 in .github/workflows/e2e-tests-ios.yml
|
||
with: | ||
path: | | ||
${{ env.APP_PATH }} | ||
${{ env.APP_PATH }}.dSYM | ||
key: ${{ runner.os }}-${{ env.KEY }} | ||
- uses: actions/setup-node@v3 | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
with: | ||
node-version: 14.18.1 | ||
cache: 'yarn' | ||
- name: Install npm dependencies (example project) | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
working-directory: ./examples/${{ env.PROJECT_NAME }}/ | ||
run: yarn install --frozen-lockfile | ||
- name: Install npm dependencies (root) | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
working-directory: ./ | ||
run: yarn install --frozen-lockfile | ||
- name: Setup Ruby | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
working-directory: ./examples/${{ env.PROJECT_NAME }}/ | ||
- name: setup-cocoapods | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
uses: maxim-lobanov/setup-cocoapods@v1 | ||
with: | ||
version: 1.11.3 | ||
- name: Install CocoaPods | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
working-directory: ./examples/${{ env.PROJECT_NAME }}/ | ||
run: | | ||
yarn pods | ||
- name: Select Xcode | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer | ||
- name: Build | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
working-directory: ./examples/${{ env.PROJECT_NAME }}/ios/ | ||
run: | | ||
set -o pipefail && xcodebuild \ | ||
-workspace "${{ env.PROJECT_NAME }}.xcworkspace" \ | ||
-scheme "${{ env.PROJECT_NAME }}" \ | ||
-destination "platform=iOS Simulator,name=iPhone 14,OS=16.4" \ | ||
-derivedDataPath "DerivedData" \ | ||
-configuration "Release" \ | ||
| tee xcodebuild.log | ||
e2e-ios: | ||
name: e2e tests | ||
runs-on: macos-13 | ||
environment: e2e | ||
needs: [build-ios] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
id: cache | ||
with: | ||
path: | | ||
${{ env.APP_PATH }} | ||
${{ env.APP_PATH }}.dSYM | ||
key: ${{ runner.os }}-${{ hashFiles('src/**', 'ios/**', 'examples/${{ env.PROJECT_NAME }}/src/**') }} | ||
- uses: mobile-dev-inc/[email protected] | ||
with: | ||
api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }} | ||
app-file: ${{ env.APP_PATH }} | ||
mapping-file: ${{ env.APP_PATH }}.dSYM | ||
include-tags: ios | ||
- name: Upload logs when workflow failed | ||
uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: BuildLogs | ||
path: | | ||
xcodebuild.log | ||
DerivedData/Logs/Test/*.xcresult |