diff --git a/.github/workflows/verify-older-os-compatibility.yml b/.github/workflows/verify-older-os-compatibility.yml new file mode 100644 index 0000000000..f644277edd --- /dev/null +++ b/.github/workflows/verify-older-os-compatibility.yml @@ -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 }}" diff --git a/README.md b/README.md index c11f46c5db..7c045d8792 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/Scripts/test-carthage-integration.sh b/Scripts/test-carthage-integration.sh index 94b41684e8..f4810cdbab 100755 --- a/Scripts/test-carthage-integration.sh +++ b/Scripts/test-carthage-integration.sh @@ -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