-
Notifications
You must be signed in to change notification settings - Fork 433
89 lines (85 loc) · 2.42 KB
/
test.yml
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
on: pull_request
name: Test
jobs:
test:
name: Test
runs-on: macos-12
strategy:
fail-fast: false
matrix:
destination: [macOS, iOS, tvOS, watchOS]
env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app/Contents/Developer
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Recover cached dependencies
uses: actions/cache@v1
id: dependency-cache
with:
path: Carthage/Checkouts
key: carthage-${{ hashFiles('Cartfile.resolved') }}
- name: Pull dependencies
if: steps.dependency-cache.outputs.cache-hit != 'true'
run: |
carthage checkout
- name: Test via xcodebuild
run: |
ACTION=test
DESTINATION=unknown
SCHEME=unknown
case "${{ matrix.destination }}" in
"iOS")
DESTINATION="platform=iOS Simulator,name=iPhone 11 Pro"
SCHEME=ReactiveSwift-iOS
;;
"tvOS")
DESTINATION="platform=tvOS Simulator,name=Apple TV"
SCHEME=ReactiveSwift-tvOS
;;
"watchOS")
ACTION=build
DESTINATION="platform=watchOS Simulator,name=Apple Watch Series 5 (44mm)"
SCHEME=ReactiveSwift-watchOS
;;
"macCatalyst")
DESTINATION="platform=macOS,variant=Mac Catalyst"
SCHEME=ReactiveSwift-iOS
;;
"macOS")
DESTINATION="platform=macOS,arch=x86_64"
SCHEME=ReactiveSwift-macOS
;;
*)
echo "Unknown destination."
exit 1
;;
esac
xcodebuild clean ${ACTION} \
-destination "${DESTINATION}" \
-scheme ${SCHEME} \
-workspace ReactiveSwift.xcworkspace \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
ONLY_ACTIVE_ARCH=YES
swiftpm-linux:
strategy:
matrix:
swift: ["5.7"]
name: SwiftPM Linux
runs-on: ubuntu-22.04
steps:
- name: Setup Swift version
uses: swift-actions/setup-swift@v1
with:
swift-version: ${{ matrix.swift }}
- name: Checkout
uses: actions/checkout@v2
- name: Pull dependencies
run: |
swift package resolve
- name: Test via SwiftPM
run: |
swift --version
swift build
swift test