From f0308945aa12446820e16627c9fa872e8f40ecaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Buczek?= Date: Wed, 18 Oct 2023 17:01:10 +0200 Subject: [PATCH] Fix brave/brave-ios#8188: Add ability to run tests against the latest iOS version. (brave/brave-ios#8180) --- .github/workflows/test_all_on_pr.yml | 41 ++++++++++++++++++++++++++++ fastlane/Fastfile | 6 ++-- 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test_all_on_pr.yml diff --git a/.github/workflows/test_all_on_pr.yml b/.github/workflows/test_all_on_pr.yml new file mode 100644 index 000000000000..5cd91c2358b8 --- /dev/null +++ b/.github/workflows/test_all_on_pr.yml @@ -0,0 +1,41 @@ +name: Test all + +on: + pull_request: + types: [ labeled, opened, synchronize ] + +jobs: + test_all: + if: >- + (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'CI/test_all') || + (github.event_name == 'pull_request' && github.event.action == 'opened' && contains(github.event.pull_request.labels.*.name, 'CI/test_all')) || + (github.event_name == 'pull_request' && github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'CI/test_all')) + name: Test all supported major platform versions + runs-on: macOS-13 + env: + # The XCode version to use. If you want to update it please refer to this document: + # https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners#supported-software + # and set proper version. + XCODE_VERSION: "14.3.1" + + steps: + - name: Select XCode + # Use XCODE_VERSION env variable to set the XCode version you want. + run: sudo xcode-select --switch /Applications/Xcode_${{ env.XCODE_VERSION }}.app + - name: Checkout + uses: actions/checkout@v3 + - name: Update node + uses: actions/setup-node@v3 + with: + node-version: '18.x' + - uses: actions/cache@v3 + with: + path: ~/.npm + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: npm- + - name: Run bootstrap script + run: ./bootstrap.sh --ci + - name: Run tests + run: | + set -o pipefail + fastlane ios test test_all:true diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 24309bf82e04..e51356cfcac1 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -37,8 +37,9 @@ platform :ios do run_tests( project: "App/Client.xcodeproj", scheme: "Debug", - device: "iPhone 14 (16.4)", + devices: options[:test_all] ? ["iPhone 14 (16.4)", "iPhone 14 (17.0)"] : ["iPhone 14 (16.4)"], code_coverage: true, + ensure_devices_found: true, skip_testing: [ "CertificateUtilitiesTests/CertificatePinningTest/testSelfSignedRootAllowed", "CertificateUtilitiesTests/CertificatePinningTest/testSelfSignedRootAllowed2", @@ -70,8 +71,9 @@ platform :ios do run_tests( project: "App/Client.xcodeproj", scheme: "Debug", - device: "iPad (10th generation) (16.4)", + devices: options[:test_all] ? ["iPad (10th generation) (16.4)", "iPad (10th generation) (17.0)"] : ["iPad (10th generation) (16.4)"], code_coverage: true, + ensure_devices_found: true, skip_testing: [ "ClientTests/UserAgentTests" ],