-
Notifications
You must be signed in to change notification settings - Fork 19
162 lines (157 loc) · 5.65 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
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:
NSUnbufferedIO: YES
jobs:
SwiftBuild:
name: Swift Unit Tests
strategy:
matrix:
os: [macos-latest-large, ubuntu-latest]
swift_version: ["5.10", "6.0"]
exclude:
- os: ubuntu-latest
swift_version: "6.0"
env:
DEVELOPER_DIR: /Applications/Xcode_16.0.app/Contents/Developer
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- uses: SwiftyLab/setup-swift@v1
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
env:
DEVELOPER_DIR: /Applications/Xcode_16.0.app/Contents/Developer
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
XcodeBuild:
name: Xcode Unit Tests
strategy:
matrix:
include:
- destination: "platform=iOS Simulator,OS=16.4,name=iPhone 14 Pro Max"
xcode_version: "15.4"
os: macos-latest-large
- destination: "platform=iOS Simulator,OS=17.5,name=iPhone 15 Pro Max"
xcode_version: "16.0"
os: macos-latest-large
- destination: "platform=tvOS Simulator,OS=17.5,name=Apple TV"
xcode_version: "16.0"
os: macos-latest-large
- destination: "platform=visionOS Simulator,OS=1.2,name=Apple Vision Pro"
xcode_version: "15.4"
os: macos-latest-xlarge
- destination: "platform=visionOS Simulator,OS=2.0,name=Apple Vision Pro"
xcode_version: "16.0"
os: macos-15-xlarge
- destination: "platform=watchOS Simulator,OS=10.5,name=Apple Watch Series 7 (45mm)"
xcode_version: "16.0"
os: macos-latest-large
- destination: "platform=macOS,name=My Mac"
xcode_version: "16.0"
os: macos-latest-large
runs-on: ${{ matrix.os }}
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer
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 "${{ matrix.destination }}" 2>&1
- name: Test AuthFoundation
run: |
set -o pipefail && xcodebuild test \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme AuthFoundation \
-destination "${{ matrix.destination }}" 2>&1
- name: Build OktaDirectAuth
run: |
set -o pipefail && xcodebuild build \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme OktaDirectAuth \
-destination "${{ matrix.destination }}" 2>&1
- name: Test OktaDirectAuth
run: |
set -o pipefail && xcodebuild test \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme OktaDirectAuth \
-destination "${{ matrix.destination }}" 2>&1
- name: Build OktaOAuth2
run: |
set -o pipefail && xcodebuild build \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme OktaOAuth2 \
-destination "${{ matrix.destination }}" 2>&1
- name: Test OktaOAuth2
run: |
set -o pipefail && xcodebuild test \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme OktaOAuth2 \
-destination "${{ matrix.destination }}" 2>&1
- name: Build WebAuthenticationUI
if: "!contains(matrix.destination, 'tvOS') && !contains(matrix.destination, 'watchOS')"
run: |
set -o pipefail && xcodebuild build \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme WebAuthenticationUI \
-destination "${{ matrix.destination }}" 2>&1
- name: Test WebAuthenticationUI
if: "!contains(matrix.destination, 'tvOS') && !contains(matrix.destination, 'watchOS')"
run: |
set -o pipefail && xcodebuild test \
-derivedDataPath ../Build/DerivedData \
-clonedSourcePackagesDirPath ../Build/ClonedSources \
-scheme WebAuthenticationUI \
-destination "${{ matrix.destination }}" 2>&1