Skip to content

Commit 94ae534

Browse files
committed
Upgrade the github-ci to macOS 14
1 parent e057a3c commit 94ae534

File tree

1 file changed

+61
-52
lines changed

1 file changed

+61
-52
lines changed

.github/workflows/CI.yml

Lines changed: 61 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,24 @@ permissions:
1414
jobs:
1515
Pods:
1616
name: Cocoapods Lint
17-
runs-on: macos-13
17+
runs-on: macos-14
1818
env:
19-
DEVELOPER_DIR: /Applications/Xcode_14.1.app
19+
DEVELOPER_DIR: /Applications/Xcode_15.2.app
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
2323

2424
- name: Install Cocoapods
2525
run: gem install cocoapods --no-document --quiet
2626

2727
- name: Install Xcpretty
2828
run: gem install xcpretty --no-document --quiet
29+
30+
- name: Pod Update
31+
run: pod repo update --silent
32+
33+
- name: Pod Install
34+
run: pod install
2935

3036
- name: Run SDWebImageSwiftUI podspec lint
3137
run: |
@@ -34,24 +40,23 @@ jobs:
3440
3541
Demo:
3642
name: Run Demo
37-
runs-on: macos-13
43+
runs-on: macos-14
3844
env:
39-
DEVELOPER_DIR: /Applications/Xcode_14.1.app
45+
DEVELOPER_DIR: /Applications/Xcode_15.2.app
4046
WORKSPACE_NAME: SDWebImageSwiftUI.xcworkspace
4147
OSXSCHEME: SDWebImageSwiftUIDemo-macOS
4248
iOSSCHEME: SDWebImageSwiftUIDemo
4349
TVSCHEME: SDWebImageSwiftUIDemo-tvOS
4450
WATCHSCHEME: SDWebImageSwiftUIDemo-watchOS WatchKit App
45-
strategy:
46-
matrix:
47-
iosDestination: ["platform=iOS Simulator,name=iPhone 14 Pro"]
48-
tvOSDestination: ["platform=tvOS Simulator,name=Apple TV"]
49-
watchOSDestination: ["platform=watchOS Simulator,name=Apple Watch Series 8 (45mm)"]
50-
macOSDestination: ["platform=macOS"]
51-
macCatalystDestination: ["platform=macOS,variant=Mac Catalyst"]
51+
iosDestination: platform=iOS Simulator,name=iPhone 15 Pro
52+
macOSDestination: platform=macOS,arch=x86_64
53+
macCatalystDestination: platform=macOS,arch=x86_64,variant=Mac Catalyst
54+
tvOSDestination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation)
55+
watchOSDestination: platform=watchOS Simulator,name=Apple Watch Series 9 (45mm)
56+
visionOSDestination: platform=visionOS Simulator,name=Apple Vision Pro
5257
steps:
5358
- name: Checkout
54-
uses: actions/checkout@v2
59+
uses: actions/checkout@v3
5560

5661
- name: Clean DerivedData
5762
run: |
@@ -73,46 +78,58 @@ jobs:
7378
- name: Run demo for OSX
7479
run: |
7580
set -o pipefail
76-
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.OSXSCHEME }}" -destination "${{ matrix.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
81+
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.OSXSCHEME }}" -destination "${{ env.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
7782
7883
- name: Run demo for iOS
7984
run: |
8085
set -o pipefail
81-
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.iOSSCHEME }}" -destination "${{ matrix.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
86+
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.iOSSCHEME }}" -destination "${{ env.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
8287
8388
- name: Run demo for TV
8489
run: |
8590
set -o pipefail
86-
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.TVSCHEME }}" -destination "${{ matrix.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
91+
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.TVSCHEME }}" -destination "${{ env.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
8792
8893
- name: Run demo for Watch
8994
run: |
9095
set -o pipefail
91-
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.WATCHSCHEME }}" -destination "${{ matrix.watchOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
96+
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.WATCHSCHEME }}" -destination "${{ env.watchOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
9297
9398
Test:
9499
name: Unit Test
95-
runs-on: macos-13
100+
runs-on: macos-14
96101
env:
97-
DEVELOPER_DIR: /Applications/Xcode_14.1.app
102+
DEVELOPER_DIR: /Applications/Xcode_15.2.app
98103
WORKSPACE_NAME: SDWebImageSwiftUI.xcworkspace
99-
OSXSCHEME: SDWebImageSwiftUITests macOS
100-
iOSSCHEME: SDWebImageSwiftUITests
101-
TVSCHEME: SDWebImageSwiftUITests tvOS
104+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
105+
# use matrix to generate jobs for each platform
102106
strategy:
107+
fail-fast: false
103108
matrix:
104-
iosDestination: ["platform=iOS Simulator,name=iPhone 14 Pro"]
105-
macOSDestination: ["platform=macOS"]
106-
tvOSDestination: ["platform=tvOS Simulator,name=Apple TV"]
109+
platform: [iOS, macOS, tvOS]
110+
include:
111+
- platform: iOS
112+
destination: platform=iOS Simulator,name=iPhone 15 Pro
113+
scheme: SDWebImageSwiftUITests
114+
flag: ios
115+
- platform: macOS
116+
destination: platform=macOS,arch=x86_64
117+
scheme: SDWebImageSwiftUITests macOS
118+
flag: macos
119+
- platform: tvOS
120+
destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation)
121+
scheme: SDWebImageSwiftUITests tvOS
122+
flag: tvos
123+
# - platform: visionOS
124+
# destination: platform=visionOS Simulator,name=Apple Vision Pro
125+
# scheme: Vision
126+
# flag: visionos
107127
steps:
108128
- name: Checkout
109-
uses: actions/checkout@v2
129+
uses: actions/checkout@v3
130+
with:
131+
fetch-depth: 0
110132

111-
- name: Clean DerivedData
112-
run: |
113-
rm -rf ~/Library/Developer/Xcode/DerivedData/
114-
mkdir DerivedData
115-
116133
- name: Install Cocoapods
117134
run: gem install cocoapods --no-document --quiet
118135

@@ -124,47 +141,39 @@ jobs:
124141

125142
- name: Pod Install
126143
run: pod install
127-
128-
- name: Test - ${{ matrix.iosDestination }}
129-
run: |
130-
set -o pipefail
131-
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.iOSSCHEME }}" -destination "${{ matrix.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
132-
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/iOS
133-
134-
- name: Test - ${{ matrix.macOSDestination }}
144+
145+
- name: Clean DerivedData
135146
run: |
136-
set -o pipefail
137-
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.OSXSCHEME }}" -destination "${{ matrix.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
138-
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/macOS
139-
140-
- name: Test - ${{ matrix.tvOSDestination }}
147+
rm -rf ~/Library/Developer/Xcode/DerivedData/
148+
mkdir DerivedData
149+
150+
- name: Run test
141151
run: |
142152
set -o pipefail
143-
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.TVSCHEME }}" -destination "${{ matrix.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
144-
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/tvOS
153+
xcodebuild build-for-testing -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
154+
xcodebuild test-without-building -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
155+
mv ~/Library/Developer/Xcode/DerivedData/ "./DerivedData/${{ matrix.platform }}"
145156
146157
- name: Code Coverage
147158
run: |
148159
set -o pipefail
149160
export PATH="/usr/local/opt/curl/bin:$PATH"
150161
curl --version
151-
bash <(curl -s https://codecov.io/bash) -D './DerivedData/macOS' -J '^SDWebImageSwiftUI$' -c -X gcov -F macos
152-
bash <(curl -s https://codecov.io/bash) -D './DerivedData/iOS' -J '^SDWebImageSwiftUI$' -c -X gcov -F ios
153-
bash <(curl -s https://codecov.io/bash) -D './DerivedData/tvOS' -J '^SDWebImageSwiftUI$' -c -X gcov -F tvos
162+
bash <(curl -s https://codecov.io/bash) -v -D "./DerivedData/${{ matrix.platform }}" -J '^SDWebImageSwiftUI$' -c -X gcov -F "${{ matrix.flag }}"
154163
155164
Build:
156165
name: Build Library
157-
runs-on: macos-13
166+
runs-on: macos-14
158167
env:
159-
DEVELOPER_DIR: /Applications/Xcode_14.1.app
168+
DEVELOPER_DIR: /Applications/Xcode_15.2.app
160169
PROJECT_NAME: SDWebImageSwiftUI.xcodeproj
161170
OSXSCHEME: SDWebImageSwiftUI macOS
162171
iOSSCHEME: SDWebImageSwiftUI
163172
TVSCHEME: SDWebImageSwiftUI tvOS
164173
WATCHSCHEME: SDWebImageSwiftUI watchOS
165174
steps:
166175
- name: Checkout
167-
uses: actions/checkout@v2
176+
uses: actions/checkout@v3
168177

169178
- name: Build the SwiftPM
170179
run: |

0 commit comments

Comments
 (0)