Skip to content

Commit f6c7cf6

Browse files
committed
split matrix with whole jobs
1 parent 5a6820a commit f6c7cf6

File tree

1 file changed

+80
-9
lines changed

1 file changed

+80
-9
lines changed

.github/workflows/ci.yml

Lines changed: 80 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,51 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15+
test-on-macos-13:
16+
name: Test on macOS 13
17+
runs-on: macOS-13
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
xcode: ["14.3.1"]
22+
steps:
23+
- uses: actions/checkout@v2
24+
25+
- name: Cache dependencies
26+
uses: actions/cache@v2
27+
with:
28+
path: |
29+
.build/artifacts
30+
.build/checkouts
31+
.build/repositories
32+
key: ${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
33+
restore-keys: |
34+
${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
35+
${{ runner.os }}-dependencies-${{ matrix.xcode }}-
36+
37+
- name: Select Xcode
38+
run: |
39+
xcodebuild -version
40+
ls -nt /Applications/ | grep "Xcode*"
41+
sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app
42+
xcodebuild -version
43+
44+
- name: Install danger-js
45+
run: brew install danger/tap/danger-js
46+
47+
- run: swift test
48+
49+
- run: swift run danger-swift ci --verbose --failOnErrors
50+
if: ${{ github.event_name == 'pull_request' }}
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1553
test-on-macos-14:
1654
name: Test on macOS 14
1755
runs-on: macOS-14
1856
strategy:
1957
fail-fast: false
2058
matrix:
21-
xcode: ["14.3.1", "15.2", "15.4"]
59+
xcode: ["15.2", "15.4"]
2260
steps:
2361
- uses: actions/checkout@v2
2462

@@ -43,8 +81,6 @@ jobs:
4381
4482
- name: Install danger-js
4583
run: brew install danger/tap/danger-js
46-
env:
47-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer # Avoid Homebrew installation error
4884

4985
- run: swift test
5086

@@ -59,7 +95,7 @@ jobs:
5995
strategy:
6096
fail-fast: false
6197
matrix:
62-
xcode: ["14.3.1", "15.2", "15.4"]
98+
xcode: ["15.2", "15.4"]
6399
steps:
64100
- uses: actions/checkout@v2
65101

@@ -84,8 +120,6 @@ jobs:
84120
85121
- name: Install danger-js
86122
run: brew install danger/tap/danger-js
87-
env:
88-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer # Avoid Homebrew installation error
89123

90124
- run: make install
91125

@@ -135,13 +169,52 @@ jobs:
135169
env:
136170
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137171

172+
test-without-spm-on-macos-13:
173+
name: Test without SPM on macOS 13
174+
runs-on: macOS-13
175+
strategy:
176+
fail-fast: false
177+
matrix:
178+
xcode: ["14.3.1"]
179+
steps:
180+
- uses: actions/checkout@v2
181+
182+
- name: Cache dependencies
183+
uses: actions/cache@v2
184+
with:
185+
path: |
186+
.build/artifacts
187+
.build/checkouts
188+
.build/repositories
189+
key: ${{ runner.os }}-without-spm-package-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
190+
restore-keys: |
191+
${{ runner.os }}-without-spm-package-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }}
192+
${{ runner.os }}-without-spm-package-${{ matrix.xcode }}-
193+
194+
- name: Select Xcode
195+
run: |
196+
xcodebuild -version
197+
ls -nt /Applications/ | grep "Xcode*"
198+
sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app
199+
xcodebuild -version
200+
201+
- name: Install danger-js
202+
run: brew install danger/tap/danger-js
203+
204+
- run: sudo make install
205+
206+
- run: danger-swift ci --verbose --failOnErrors
207+
if: ${{ github.event_name == 'pull_request' }}
208+
env:
209+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
210+
138211
test-without-spm-on-macos-14:
139212
name: Test without SPM on macOS 14
140213
runs-on: macOS-14
141214
strategy:
142215
fail-fast: false
143216
matrix:
144-
xcode: ["14.3.1", "15.2", "15.4"]
217+
xcode: ["15.2", "15.4"]
145218
steps:
146219
- uses: actions/checkout@v2
147220

@@ -166,8 +239,6 @@ jobs:
166239
167240
- name: Install danger-js
168241
run: brew install danger/tap/danger-js
169-
env:
170-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer # Avoid Homebrew installation error
171242

172243
- run: make install
173244

0 commit comments

Comments
 (0)