Skip to content

Commit 8ad2d94

Browse files
authored
ci: Build as matrix (#106)
* ci: Build as matrix * Update ci.yml * Update ci.yml * Update ci.yml * Update windows ci.yml * attempt to test windows * Update ci.yml
1 parent 39a8751 commit 8ad2d94

File tree

1 file changed

+24
-81
lines changed

1 file changed

+24
-81
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -16,77 +16,34 @@ concurrency:
1616
cancel-in-progress: true
1717

1818
jobs:
19-
xcode-test-ios:
19+
test:
2020
timeout-minutes: 15
2121
runs-on: macos-latest
22+
strategy:
23+
matrix:
24+
destination: ['platform=iOS\ Simulator,name=iPhone\ 14\ Pro\ Max', 'platform\=tvOS\ Simulator,name\=Apple\ TV', 'platform=watchOS\ Simulator,name=Apple\ Watch\ Series\ 5\ \(40mm\)', 'platform=macOS']
25+
action: ['test', 'build']
26+
exclude:
27+
- destination: 'platform=iOS\ Simulator,name=iPhone\ 14\ Pro\ Max'
28+
action: 'build'
29+
- destination: 'platform\=tvOS\ Simulator,name\=Apple\ TV'
30+
action: 'build'
31+
- destination: 'platform=macOS'
32+
action: 'build'
33+
- destination: 'platform=watchOS\ Simulator,name=Apple\ Watch\ Series\ 5\ \(40mm\)'
34+
action: 'test'
2235
steps:
2336
- uses: actions/checkout@v3
2437
- name: Use multiple cores
2538
run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
26-
- name: Build-Test
27-
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace Parse.xcworkspace -scheme ParseSwift -destination platform\=iOS\ Simulator,name\=iPhone\ 14\ Pro\ Max -derivedDataPath DerivedData clean test | xcpretty
28-
env:
29-
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
30-
- name: Prepare codecov
31-
uses: sersoft-gmbh/swift-coverage-action@v3
32-
id: coverage-files
33-
with:
34-
format: lcov
35-
search-paths: ./DerivedData
36-
env:
37-
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
38-
- name: Upload coverage to Codecov
39-
uses: codecov/codecov-action@v3
40-
with:
41-
files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}}
42-
env_vars: IOS
43-
fail_ci_if_error: true
44-
env:
45-
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
46-
47-
xcode-test-macos:
48-
timeout-minutes: 15
49-
runs-on: macos-latest
50-
steps:
51-
- uses: actions/checkout@v3
5239
- name: Create and set the default keychain
5340
run: |
5441
security create-keychain -p "" temporary
5542
security default-keychain -s temporary
5643
security unlock-keychain -p "" temporary
5744
security set-keychain-settings -lut 7200 temporary
58-
- name: Use multiple cores
59-
run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
60-
- name: Build-Test
61-
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace Parse.xcworkspace -scheme ParseSwift -destination platform\=macOS -derivedDataPath DerivedData clean test | xcpretty
62-
env:
63-
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
64-
- name: Prepare codecov
65-
uses: sersoft-gmbh/swift-coverage-action@v3
66-
id: coverage-files
67-
with:
68-
format: lcov
69-
search-paths: ./DerivedData
70-
env:
71-
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
72-
- name: Upload coverage to Codecov
73-
uses: codecov/codecov-action@v3
74-
with:
75-
files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}}
76-
env_vars: MACOS
77-
fail_ci_if_error: true
78-
env:
79-
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
80-
81-
xcode-test-tvos:
82-
timeout-minutes: 15
83-
runs-on: macos-latest
84-
steps:
85-
- uses: actions/checkout@v3
86-
- name: Use multiple cores
87-
run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
8845
- name: Build-Test
89-
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace Parse.xcworkspace -scheme ParseSwift -destination platform\=tvOS\ Simulator,name\=Apple\ TV -derivedDataPath DerivedData clean test | xcpretty
46+
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace Parse.xcworkspace -scheme ParseSwift -derivedDataPath DerivedData -destination ${{ matrix.destination }} ${{ matrix.action }} | xcpretty -c
9047
env:
9148
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
9249
- name: Prepare codecov
@@ -101,20 +58,7 @@ jobs:
10158
uses: codecov/codecov-action@v3
10259
with:
10360
files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}}
104-
env_vars: TVOS
105-
fail_ci_if_error: true
106-
env:
107-
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
108-
109-
xcode-build-watchos:
110-
timeout-minutes: 10
111-
runs-on: macos-latest
112-
steps:
113-
- uses: actions/checkout@v3
114-
- name: Use multiple cores
115-
run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
116-
- name: Build
117-
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace Parse.xcworkspace -scheme ParseSwift -destination platform\=watchOS\ Simulator,name\=Apple\ Watch\ Series\ 8\ \(45mm\) -derivedDataPath DerivedData clean build | xcpretty
61+
fail_ci_if_error: false
11862
env:
11963
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
12064

@@ -132,7 +76,7 @@ jobs:
13276
- name: Use multiple cores
13377
run: defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
13478
- name: Build-Test
135-
run: swift test --enable-code-coverage -v
79+
run: swift test --enable-code-coverage | xcpretty -c
13680
env:
13781
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
13882
- name: Prepare codecov
@@ -148,18 +92,18 @@ jobs:
14892
with:
14993
files: ${{join(fromJSON(steps.coverage-files.outputs.files), ',')}}
15094
env_vars: SPM
151-
fail_ci_if_error: true
95+
fail_ci_if_error: false
15296
env:
15397
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
15498

15599
xcode-test-5_5:
156100
timeout-minutes: 15
157-
needs: xcode-build-watchos
101+
needs: linux
158102
runs-on: macos-12
159103
steps:
160104
- uses: actions/checkout@v3
161105
- name: Build-Test
162-
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace Parse.xcworkspace -scheme ParseSwift -destination platform\=iOS\ Simulator,name\=iPhone\ 13\ Pro\ Max -derivedDataPath DerivedData build | xcpretty
106+
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace Parse.xcworkspace -scheme ParseSwift -destination platform\=iOS\ Simulator,name\=iPhone\ 13\ Pro\ Max -derivedDataPath DerivedData build | xcpretty -c
163107
env:
164108
DEVELOPER_DIR: ${{ env.CI_XCODE_OLDEST }}
165109

@@ -191,8 +135,8 @@ jobs:
191135
- uses: actions/checkout@v3
192136
- uses: compnerd/[email protected]
193137
with:
194-
branch: swift-5.7.3-release
195-
tag: 5.7.3-RELEASE
138+
branch: swift-5.8-release
139+
tag: 5.8-RELEASE
196140
- name: Build
197141
run: |
198142
swift build -v
@@ -204,7 +148,7 @@ jobs:
204148

205149
docs:
206150
timeout-minutes: 10
207-
needs: xcode-build-watchos
151+
needs: linux
208152
runs-on: macos-latest
209153
steps:
210154
- uses: actions/checkout@v3
@@ -216,7 +160,7 @@ jobs:
216160
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
217161

218162
cocoapods:
219-
needs: xcode-build-watchos
163+
needs: linux
220164
runs-on: macos-latest
221165
steps:
222166
- uses: actions/checkout@v3
@@ -230,4 +174,3 @@ jobs:
230174
run: pod lib lint --allow-warnings
231175
env:
232176
DEVELOPER_DIR: ${{ env.CI_XCODE_LATEST }}
233-

0 commit comments

Comments
 (0)