Skip to content

Update minimum Swift, Xcode, and platform versions #438

Update minimum Swift, Xcode, and platform versions

Update minimum Swift, Xcode, and platform versions #438

Workflow file for this run

name: Tests
on:
push:
paths:
- '.github/workflows/tests.yaml'
- 'Package.swift'
- 'Sources/**/*.swift'
- 'Samples/**/*.swift'
- 'Tests/**/*.swift'
branches:
- master
pull_request:
branches:
- master
paths:
- '.github/workflows/tests.yaml'
- 'Package.swift'
- 'Sources/**/*.swift'
- 'Samples/**/*.swift'
- 'Tests/**/*.swift'
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
NSUnbufferedIO: YES
jobs:
SwiftBuild:
name: Swift Unit Tests
strategy:
matrix:
os: [macos-latest-large, ubuntu-latest]
swift_version: ["5.9", "5.10"]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- uses: swift-actions/setup-swift@v2
with:
swift-version: ${{ matrix.swift_version }}
- name: Get swift version
run: swift --version
- uses: actions/checkout@master
- name: Build
run: swift build --build-tests
- name: Test
run: swift test --parallel
Cocoapods:
name: CocoaPods Build
runs-on: macos-latest-xlarge # Running on xlarge to use arm64 chipset
timeout-minutes: 10
needs:
- SwiftBuild
steps:
- uses: actions/checkout@master
- name: OktaAuthFoundation.podspec
run: pod lib lint --allow-warnings OktaAuthFoundation.podspec
# TODO: Enable dependent podspec linting once unreleased local spec version checking is fixed.
#- name: OktaOAuth2.podspec
# run: pod lib lint --allow-warnings OktaOAuth2.podspec
#- name: OktaDirectAuth.podspec
# run: pod lib lint --allow-warnings OktaDirectAuth.podspec
#- name: OktaWebAuthenticationUI.podspec
# run: pod lib lint --allow-warnings OktaWebAuthenticationUI.podspec
XcodeBuildMatrix:
name: Setup Xcode Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
destination:
- "platform=iOS Simulator,OS=16.4,name=iPhone 14 Pro Max"
- "platform=iOS Simulator,OS=17.5,name=iPhone 15 Pro Max"
- "platform=visionOS Simulator,OS=1.2,name=Apple Vision Pro"
- "platform=watchOS Simulator,OS=10.5,name=Apple Watch Series 7 (45mm)"
- "platform=macOS,name=My Mac"
outputs:
skipWebAuthenticationUI: ${{ steps.variables.outputs.skipWebAuthenticationUI }}
destination: ${{ matrix.destination }}
steps:
- name: Set test variables
id: variables
run: |
if [ ${{ contains(matrix.destination, 'tvOS') || contains(matrix.destination, 'watchOS') }} ]; then
echo "skipWebAuthenticationUI=true" >> "$GITHUB_OUTPUT"
echo "WebAuthenticationUI is unsupported on this platform"
else
echo "skipWebAuthenticationUI=false" >> "$GITHUB_OUTPUT"
fi
shell: bash
XcodeBuild:
name: Xcode Unit Tests
runs-on: macos-latest-xlarge
needs: XcodeBuildMatrix
env:
DESTINATION: ${{needs.XcodeBuildMatrix.outputs.destination}}
SKIP_WEBAUTHENTICATIONUI: ${{needs.XcodeBuildMatrix.outputs.skipWebAuthenticationUI}}
timeout-minutes: 25
steps:
- uses: actions/checkout@master
- name: Build AuthFoundation
run: |
set -o pipefail
xcodebuild build \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme AuthFoundation \
-destination "$DESTINATION" 2>&1
- name: Test AuthFoundation
run: |
set -o pipefail && xcodebuild test \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme AuthFoundation \
-destination "$DESTINATION" 2>&1
- name: Build OktaDirectAuth
run: |
set -o pipefail && xcodebuild build \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme OktaDirectAuth \
-destination "$DESTINATION" 2>&1
- name: Test OktaDirectAuth
run: |
set -o pipefail && xcodebuild test \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme OktaDirectAuth \
-destination "$DESTINATION" 2>&1
- name: Build OktaOAuth2
run: |
set -o pipefail && xcodebuild build \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme OktaOAuth2 \
-destination "$DESTINATION" 2>&1
- name: Test OktaOAuth2
run: |
set -o pipefail && xcodebuild test \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme OktaOAuth2 \
-destination "$DESTINATION" 2>&1
- name: Build WebAuthenticationUI
if: env.SKIP_WEBAUTHENTICATIONUI == 'true'
run: |
set -o pipefail && xcodebuild build \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme WebAuthenticationUI \
-destination "$DESTINATION" 2>&1
- name: Test WebAuthenticationUI
if: env.SKIP_WEBAUTHENTICATIONUI == 'true'
run: |
set -o pipefail && xcodebuild test \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme WebAuthenticationUI \
-destination "$DESTINATION" 2>&1