-
Notifications
You must be signed in to change notification settings - Fork 231
187 lines (156 loc) · 6.91 KB
/
CI.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
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: "SDWebImageSwiftUI CI"
on:
push:
branches:
- master
pull_request:
branches:
- '*'
permissions:
contents: read
jobs:
Pods:
name: Cocoapods Lint
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Cocoapods
run: gem install cocoapods --no-document --quiet
- name: Install Xcpretty
run: gem install xcpretty --no-document --quiet
- name: Run SDWebImageSwiftUI podspec lint
run: |
set -o pipefail
pod lib lint SDWebImageSwiftUI.podspec --allow-warnings --skip-tests
Demo:
name: Run Demo
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app
WORKSPACE_NAME: SDWebImageSwiftUI.xcworkspace
OSXSCHEME: SDWebImageSwiftUIDemo-macOS
iOSSCHEME: SDWebImageSwiftUIDemo
TVSCHEME: SDWebImageSwiftUIDemo-tvOS
WATCHSCHEME: SDWebImageSwiftUIDemo-watchOS WatchKit App
strategy:
matrix:
iosDestination: ["platform=iOS Simulator,name=iPhone 14 Pro"]
tvOSDestination: ["platform=tvOS Simulator,name=Apple TV"]
watchOSDestination: ["platform=watchOS Simulator,name=Apple Watch Series 8 (45mm)"]
macOSDestination: ["platform=macOS"]
macCatalystDestination: ["platform=macOS,variant=Mac Catalyst"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Clean DerivedData
run: |
rm -rf ~/Library/Developer/Xcode/DerivedData/
mkdir DerivedData
- name: Install Cocoapods
run: gem install cocoapods --no-document --quiet
- name: Install Xcpretty
run: gem install xcpretty --no-document --quiet
- name: Pod Update
run: pod repo update --silent
- name: Pod Install
run: pod install
- name: Run demo for OSX
run: |
set -o pipefail
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.OSXSCHEME }}" -destination "${{ matrix.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
- name: Run demo for iOS
run: |
set -o pipefail
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.iOSSCHEME }}" -destination "${{ matrix.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
- name: Run demo for TV
run: |
set -o pipefail
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.TVSCHEME }}" -destination "${{ matrix.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
- name: Run demo for Watch
run: |
set -o pipefail
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.WATCHSCHEME }}" -destination "${{ matrix.watchOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
Test:
name: Unit Test
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app
WORKSPACE_NAME: SDWebImageSwiftUI.xcworkspace
OSXSCHEME: SDWebImageSwiftUITests macOS
iOSSCHEME: SDWebImageSwiftUITests
TVSCHEME: SDWebImageSwiftUITests tvOS
strategy:
matrix:
iosDestination: ["platform=iOS Simulator,name=iPhone 14 Pro"]
macOSDestination: ["platform=macOS"]
tvOSDestination: ["platform=tvOS Simulator,name=Apple TV"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Clean DerivedData
run: |
rm -rf ~/Library/Developer/Xcode/DerivedData/
mkdir DerivedData
- name: Install Cocoapods
run: gem install cocoapods --no-document --quiet
- name: Install Xcpretty
run: gem install xcpretty --no-document --quiet
- name: Pod Update
run: pod repo update --silent
- name: Pod Install
run: pod install
- name: Test - ${{ matrix.iosDestination }}
run: |
set -o pipefail
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.iOSSCHEME }}" -destination "${{ matrix.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/iOS
- name: Test - ${{ matrix.macOSDestination }}
run: |
set -o pipefail
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.OSXSCHEME }}" -destination "${{ matrix.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/macOS
- name: Test - ${{ matrix.tvOSDestination }}
run: |
set -o pipefail
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.TVSCHEME }}" -destination "${{ matrix.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/tvOS
- name: Code Coverage
run: |
set -o pipefail
export PATH="/usr/local/opt/curl/bin:$PATH"
curl --version
bash <(curl -s https://codecov.io/bash) -D './DerivedData/macOS' -J '^SDWebImageSwiftUI$' -c -X gcov -F macos
bash <(curl -s https://codecov.io/bash) -D './DerivedData/iOS' -J '^SDWebImageSwiftUI$' -c -X gcov -F ios
bash <(curl -s https://codecov.io/bash) -D './DerivedData/tvOS' -J '^SDWebImageSwiftUI$' -c -X gcov -F tvos
Build:
name: Build Library
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_14.1.app
PROJECT_NAME: SDWebImageSwiftUI.xcodeproj
OSXSCHEME: SDWebImageSwiftUI macOS
iOSSCHEME: SDWebImageSwiftUI
TVSCHEME: SDWebImageSwiftUI tvOS
WATCHSCHEME: SDWebImageSwiftUI watchOS
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build the SwiftPM
run: |
set -o pipefail
swift build
rm -rf ~/.build
- name: Install Carthage
run: brew install carthage
- name: Carthage Update
run: ./carthage.sh update --platform "iOS, tvOS, macOS, watchOS"
- name: Build as dynamic frameworks
run: |
set -o pipefail
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.OSXSCHEME }}" -sdk macosx -configuration Release | xcpretty -c
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.iOSSCHEME }}" -sdk iphoneos -configuration Release | xcpretty -c
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.TVSCHEME }}" -sdk appletvos -configuration Release | xcpretty -c
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.WATCHSCHEME }}" -sdk watchos -configuration Release | xcpretty -c