From 34b9c345971ebf67cc7bfa73416ff21915499641 Mon Sep 17 00:00:00 2001 From: Tom Van Laerhoven Date: Wed, 20 Nov 2024 08:48:44 +0100 Subject: [PATCH] Optimize e2e workflow conditions --- .github/workflows/pr_android.yml | 7 +++++++ .github/workflows/pr_ios.yml | 14 +++++++++++--- e2e/package.json | 3 ++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr_android.yml b/.github/workflows/pr_android.yml index 3b9ab26b8..491a075c7 100644 --- a/.github/workflows/pr_android.yml +++ b/.github/workflows/pr_android.yml @@ -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: diff --git a/.github/workflows/pr_ios.yml b/.github/workflows/pr_ios.yml index 0eb5ed1fb..864198a38 100644 --- a/.github/workflows/pr_ios.yml +++ b/.github/workflows/pr_ios.yml @@ -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 @@ -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 diff --git a/e2e/package.json b/e2e/package.json index a8cda63a2..a6c35f309 100644 --- a/e2e/package.json +++ b/e2e/package.json @@ -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" },