Skip to content

Commit f263e8e

Browse files
committed
Change to use CocoaPods to manage test case instead of Carthage
1 parent ef03282 commit f263e8e

File tree

13 files changed

+832
-657
lines changed

13 files changed

+832
-657
lines changed

.github/workflows/CI.yml

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,40 +53,39 @@ jobs:
5353
- name: Checkout
5454
uses: actions/checkout@v2
5555

56+
- name: Clean DerivedData
57+
run: |
58+
rm -rf ~/Library/Developer/Xcode/DerivedData/
59+
mkdir DerivedData
60+
5661
- name: Install Cocoapods
5762
run: gem install cocoapods --no-document --quiet
5863

5964
- name: Install Xcpretty
6065
run: gem install xcpretty --no-document --quiet
6166

6267
- name: Pod Update
63-
working-directory: ./Example
6468
run: pod repo update --silent
6569

6670
- name: Pod Install
67-
working-directory: ./Example
6871
run: pod install
6972

7073
- name: Run demo for OSX
71-
working-directory: ./Example
7274
run: |
7375
set -o pipefail
7476
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.OSXSCHEME }}" -destination "${{ matrix.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
7577
7678
- name: Run demo for iOS
77-
working-directory: ./Example
7879
run: |
7980
set -o pipefail
8081
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.iOSSCHEME }}" -destination "${{ matrix.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
8182
8283
- name: Run demo for TV
83-
working-directory: ./Example
8484
run: |
8585
set -o pipefail
8686
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.TVSCHEME }}" -destination "${{ matrix.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
8787
8888
- name: Run demo for Watch
89-
working-directory: ./Example
9089
run: |
9190
set -o pipefail
9291
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.WATCHSCHEME }}" -destination "${{ matrix.watchOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
@@ -96,7 +95,7 @@ jobs:
9695
runs-on: macos-11
9796
env:
9897
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
99-
PROJECT_NAME: SDWebImageSwiftUI.xcodeproj
98+
WORKSPACE_NAME: SDWebImageSwiftUI.xcworkspace
10099
OSXSCHEME: SDWebImageSwiftUITests macOS
101100
iOSSCHEME: SDWebImageSwiftUITests
102101
TVSCHEME: SDWebImageSwiftUITests tvOS
@@ -108,34 +107,40 @@ jobs:
108107
steps:
109108
- name: Checkout
110109
uses: actions/checkout@v2
111-
112-
- name: Install Carthage
113-
run: brew install carthage
114-
115-
- name: Carthage Update
116-
run: ./carthage.sh update --platform "iOS, tvOS, macOS"
117110

118111
- name: Clean DerivedData
119112
run: |
120113
rm -rf ~/Library/Developer/Xcode/DerivedData/
121114
mkdir DerivedData
115+
116+
- name: Install Cocoapods
117+
run: gem install cocoapods --no-document --quiet
118+
119+
- name: Install Xcpretty
120+
run: gem install xcpretty --no-document --quiet
121+
122+
- name: Pod Update
123+
run: pod repo update --silent
124+
125+
- name: Pod Install
126+
run: pod install
122127

123128
- name: Test - ${{ matrix.iosDestination }}
124129
run: |
125130
set -o pipefail
126-
xcodebuild test -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.iOSSCHEME }}" -destination "${{ matrix.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
131+
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.iOSSCHEME }}" -destination "${{ matrix.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
127132
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/iOS
128133
129134
- name: Test - ${{ matrix.macOSDestination }}
130135
run: |
131136
set -o pipefail
132-
xcodebuild test -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.OSXSCHEME }}" -destination "${{ matrix.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
137+
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.OSXSCHEME }}" -destination "${{ matrix.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
133138
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/macOS
134139
135140
- name: Test - ${{ matrix.tvOSDestination }}
136141
run: |
137142
set -o pipefail
138-
xcodebuild test -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.TVSCHEME }}" -destination "${{ matrix.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
143+
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.TVSCHEME }}" -destination "${{ matrix.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
139144
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/tvOS
140145
141146
- name: Code Coverage
@@ -153,7 +158,10 @@ jobs:
153158
env:
154159
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
155160
PROJECT_NAME: SDWebImageSwiftUI.xcodeproj
156-
SCHEME_NAME: SDWebImageSwiftUI
161+
OSXSCHEME: SDWebImageSwiftUI macOS
162+
iOSSCHEME: SDWebImageSwiftUI
163+
TVSCHEME: SDWebImageSwiftUI tvOS
164+
WATCHSCHEME: SDWebImageSwiftUI watchOS
157165
steps:
158166
- name: Checkout
159167
uses: actions/checkout@v2
@@ -163,3 +171,17 @@ jobs:
163171
set -o pipefail
164172
swift build
165173
rm -rf ~/.build
174+
175+
- name: Install Carthage
176+
run: brew install carthage
177+
178+
- name: Carthage Update
179+
run: ./carthage.sh update --platform "iOS, tvOS, macOS, watchOS"
180+
181+
- name: Build as dynamic frameworks
182+
run: |
183+
set -o pipefail
184+
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.OSXSCHEME }}" -sdk macosx -configuration Release | xcpretty -c
185+
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.iOSSCHEME }}" -sdk iphoneos -configuration Release | xcpretty -c
186+
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.TVSCHEME }}" -sdk appletvos -configuration Release | xcpretty -c
187+
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.WATCHSCHEME }}" -sdk watchos -configuration Release | xcpretty -c

Example/Podfile

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)