Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restoring Compatibility Tests #1975

Merged
merged 4 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
110 changes: 110 additions & 0 deletions .github/workflows/verify-older-os-compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Compatibility Test

on:
workflow_dispatch:
push:
branches:
- develop
- release/**

jobs:
tests:
runs-on: ${{ matrix.os }}
continue-on-error: false
strategy:
fail-fast: false
matrix:
include:

- version: '17.2'
runtime: 'iOS-17-2'
device: 'iPhone 15'
displayname: 'iPhone-15'
os: 'macos-14-xlarge'
xcode_version: '15.1'
needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 15

- version: '17.2'
runtime: 'iOS-17-2'
device: 'iPad Air (5th generation)'
displayname: 'iPad-Air-5'
os: 'macos-14-xlarge'
xcode_version: '15.1'
needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 15

- version: '16.4'
runtime: 'iOS-16-4'
device: 'iPhone 14'
displayname: 'iPhone-14'
os: 'macos-13'
xcode_version: '14.3'
needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 14

# Github deprecated macos-12 runners
# so we have to find another solution to test on older iOS versions
#
# - version: '15.0'
# runtime: 'iOS-15-0'
# device: 'iPhone 13'
# displayname: 'iPhone-13'
# os: 'macos-12-xl'
# needs_custom_sim: true
#
# - version: '14.2'
# device: 'iPhone 12'
# displayname: 'iPhone-12'
# runtime: 'iOS-14-2'
# os: 'macos-12-xl'
# needs_custom_sim: true
#
# - version: '13.7'
# runtime: 'iOS-13-7'
# device: 'iPhone 11'
# displayname: 'iPhone-11'
# os: 'macos-12-xl'
# needs_custom_sim: true

steps:
- uses: actions/checkout@v4
- uses: n1hility/cancel-previous-runs@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare custom devices
run: |
sudo mkdir -p /Library/Developer/CoreSimulator/Profiles/Runtimes

- name: Select Xcode ${{ matrix.xcode_version }}
if: matrix.xcode_version != ''
run: |
ls /Applications/Xcode_*.app
sudo xcode-select -s /Applications/Xcode_${xcode_version}.app/Contents/Developer
env:
xcode_version: ${{ matrix.xcode_version }}

- name: Download simulator if needed (${{ matrix.version }})
if: matrix.needs_custom_sim
run: |
xcversion simulators --install="iOS ${version}"
env:
version: ${{ matrix.version }}

- name: Create simulator ${{ matrix.version }}
run: |
xcrun simctl list devices ${version}
xcrun simctl create ${displayname} "${device}" "com.apple.CoreSimulator.SimRuntime.${runtime}"
env:
version: ${{ matrix.version }}
displayname: ${{ matrix.displayname }}
device: ${{ matrix.device }}
runtime: ${{ matrix.runtime }}

- name: Build and test
run: |
xcodebuild -version
xcodebuild build test -project ${project} -scheme "${scheme}" ${params} -destination "${destination}" ## | xcpretty --utf --color && exit ${PIPESTATUS[0]}
env:
project: 'Adyen.xcodeproj'
params: "-skipPackagePluginValidation"
scheme: 'IntegrationUIKitTests'
destination: "OS=${{ matrix.version }},name=${{ matrix.displayname }}"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/adyen/adyen-ios/build.yml?branch=develop)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/adyen/adyen-ios/verify-older-os-compatibility.yml?branch=develop)
[![Pod](https://img.shields.io/cocoapods/v/Adyen.svg?style=flat)](http://cocoapods.org/pods/Adyen)
[![carthage compatible](https://img.shields.io/badge/carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![SwiftPM](https://img.shields.io/badge/swift%20package%20manager-compatible-brightgreen.svg)](https://swiftpackageregistry.com/Adyen/adyen-ios)
Expand Down
2 changes: 1 addition & 1 deletion Scripts/test-carthage-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ cp "../Demo/Configuration.swift" Source/Configuration.swift
xcodegen generate

echo_header "Run Tests"
xcodebuild build test -project $PROJECT_NAME.xcodeproj -scheme App -destination "name=iPhone 15" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty && exit ${PIPESTATUS[0]}
xcodebuild build test -project $PROJECT_NAME.xcodeproj -scheme App -destination "name=iPhone 16" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty && exit ${PIPESTATUS[0]}

if [ "$NEED_CLEANUP" == true ]
then
Expand Down
Loading