Skip to content

Commit 61d1fc1

Browse files
committed
use matrix strategy
1 parent 6a12559 commit 61d1fc1

File tree

1 file changed

+8
-37
lines changed

1 file changed

+8
-37
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ on:
66
- ci
77

88
jobs:
9-
run-tvos-tests:
9+
run-tests:
1010
runs-on: macos-latest
11+
strategy:
12+
matrix:
13+
device_model: ['iPhone 8', 'Apple TV 4K']
1114
steps:
1215
- uses: actions/checkout@v2
1316
- uses: maxim-lobanov/setup-xcode@v1
@@ -24,48 +27,16 @@ jobs:
2427
run: |
2528
sh ./Consumption-Tests/Shared/carthage.sh bootstrap --cache-builds --use-xcframeworks
2629
- uses: futureware-tech/simulator-action@v1
27-
id: apple_tv
30+
id: simulator
2831
with:
29-
model: 'Apple TV 4K'
30-
- name: "Run tvOS Tests"
32+
model: ${{ matrix.device_model }}
33+
- name: "Run ${{ matrix.device_model }} Tests"
3134
run: |
3235
set -o pipefail && env NSUnbufferedIO=YES xcodebuild \
3336
-project PusherSwift.xcodeproj \
3437
-scheme PusherSwift \
3538
build \
3639
COMPILER_INDEX_STORE_ENABLE=NO \
3740
test \
38-
-destination "id=${{ steps.apple_tv.outputs.udid }}" \
39-
| xcpretty --color
40-
41-
run-ios-tests:
42-
runs-on: macos-latest
43-
steps:
44-
- uses: actions/checkout@v2
45-
- uses: maxim-lobanov/setup-xcode@v1
46-
name: "Build for testing"
47-
with:
48-
xcode-version: '13.2.1'
49-
- uses: actions/cache@v1
50-
id: carthage-cache
51-
with:
52-
path: Carthage
53-
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
54-
- name: Carthage
55-
if: steps.carthage-cache.outputs.cache-hit != 'true'
56-
run: |
57-
sh ./Consumption-Tests/Shared/carthage.sh bootstrap --cache-builds --use-xcframeworks
58-
- uses: futureware-tech/simulator-action@v1
59-
id: iphone_simulator
60-
with:
61-
model: 'iPhone 8'
62-
- name: "Run iOS Tests"
63-
run: |
64-
set -o pipefail && env NSUnbufferedIO=YES xcodebuild \
65-
-project PusherSwift.xcodeproj \
66-
-scheme PusherSwift \
67-
build \
68-
COMPILER_INDEX_STORE_ENABLE=NO \
69-
test \
70-
-destination "id=${{ steps.iphone_simulator.outputs.udid }}" \
41+
-destination "id=${{ steps.simulator.outputs.udid }}" \
7142
| xcpretty --color

0 commit comments

Comments
 (0)