Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #8188: Add ability to run tests against the latest iOS version. #8180

Merged
merged 13 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- development
- beta
pull_request:
types: [ labeled, opened, synchronize ]

jobs:
test:
Expand Down Expand Up @@ -39,3 +40,38 @@ jobs:
run: |
set -o pipefail
fastlane ios test

test_latest_os:
if: >-
iccub marked this conversation as resolved.
Show resolved Hide resolved
(github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'CI/latest_os') ||
(github.event_name == 'pull_request' && github.event.action == 'opened' && contains(github.event.pull_request.labels.*.name, 'CI/latest_os')) ||
(github.event_name == 'pull_request' && github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'CI/latest_os'))
name: Run latest OS tests
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 use_latest_os:true
13 changes: 11 additions & 2 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ default_platform :ios

CONFIG_PATH = "../App/Configuration"
LOCAL_PATH = "#{CONFIG_PATH}/Local"
DEFAULT_IOS_SIMULATOR_VERSION = "16.4"
LATEST_IOS_SIMULATOR_VERSION = "17.0"

def device_version(options)
options[:use_latest_os] ? LATEST_IOS_SIMULATOR_VERSION : DEFAULT_IOS_SIMULATOR_VERSION
end

platform :ios do
before_all do |lane, options|
device_version options
unless lane == :test || options[:skip_bootstrap]
sh("pushd .. && ./bootstrap.sh --ci && popd")
end
Expand All @@ -37,8 +44,9 @@ platform :ios do
run_tests(
project: "App/Client.xcodeproj",
scheme: "Debug",
device: "iPhone 14 (16.4)",
device: "iPhone 14 (#{device_version(options)})",
code_coverage: true,
ensure_devices_found: true,
skip_testing: [
"CertificateUtilitiesTests/CertificatePinningTest/testSelfSignedRootAllowed",
"CertificateUtilitiesTests/CertificatePinningTest/testSelfSignedRootAllowed2",
Expand Down Expand Up @@ -71,8 +79,9 @@ platform :ios do
run_tests(
project: "App/Client.xcodeproj",
scheme: "Debug",
device: "iPad (10th generation) (16.4)",
device: "iPad (10th generation) (#{device_version(options)})",
code_coverage: true,
ensure_devices_found: true,
skip_testing: [
"ClientTests/UserAgentTests"
],
Expand Down
Loading