Skip to content

Commit

Permalink
Optimize e2e workflow conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
tvanlaerhoven committed Nov 20, 2024
1 parent a950049 commit 34b9c34
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/pr_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
paths:
- .github/workflows/pr_android.yml
- example/**
- e2e/**
- package.json
- src/**
- android/**

jobs:
build:
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/pr_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ on:
workflow_dispatch:
pull_request:
types: [opened, reopened, synchronize]
paths:
- .github/workflows/pr_ios.yml
- example/**
- e2e/**
- package.json
- src/**
- ios/**

jobs:
build:
strategy:
matrix:
xcode_version: [ '15.4.0' ]
platform: [ios, tvos]
platform: [iOS, tvOS]
runs-on: macos-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -53,12 +60,13 @@ jobs:
- name: Start iOS simulator
uses: futureware-tech/simulator-action@v4
with:
model: ${{ matrix.platform == 'ios' && 'iPhone 15' || 'Apple TV 4K' }}
model: ${{ matrix.platform == 'iOS' && 'iPhone 15' || 'Apple TV' }}
os: ${{ matrix.platform }}
os_version: '>=14.0'

- name: Run e2e tests
working-directory: e2e
run: npm run test:e2e:ios
run: npm run test:e2e:${{ matrix.platform == 'iOS' && 'ios' || 'tvos' }}

- name: Summarize results
working-directory: e2e
Expand Down
3 changes: 2 additions & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"start": "npx react-native start",
"test:e2e:android": "npx cavy run-android --terminal bash --mode release",
"test:e2e:ios": "npx cavy run-ios --terminal bash",
"test:e2e:ios": "npx cavy run-ios --terminal bash --scheme ReactNativeTHEOplayer",
"test:e2e:tvos": "npx cavy run-ios --terminal bash --scheme ReactNativeTHEOplayer-tvOS",
"lint": "eslint \"**/*.{ts,tsx}\"",
"postinstall": "patch-package"
},
Expand Down

0 comments on commit 34b9c34

Please sign in to comment.