2021-10-09 16:30:38 +08:00
|
|
|
name: "SDWebImage CI"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '*'
|
|
|
|
|
2022-06-01 08:29:19 +08:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-10-09 16:30:38 +08:00
|
|
|
jobs:
|
2024-02-13 13:41:54 +08:00
|
|
|
Lint:
|
2021-10-09 16:30:38 +08:00
|
|
|
name: Cocoapods Lint
|
2024-02-23 16:16:14 +08:00
|
|
|
runs-on: macos-14
|
2021-10-09 16:30:38 +08:00
|
|
|
env:
|
2024-02-13 13:07:53 +08:00
|
|
|
DEVELOPER_DIR: /Applications/Xcode_15.2.app
|
2021-10-09 16:30:38 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-01-17 19:50:50 +08:00
|
|
|
uses: actions/checkout@v3
|
2021-10-09 16:30:38 +08:00
|
|
|
|
|
|
|
- name: Install Cocoapods
|
|
|
|
run: gem install cocoapods --no-document --quiet
|
|
|
|
|
|
|
|
- name: Install Xcpretty
|
|
|
|
run: gem install xcpretty --no-document --quiet
|
|
|
|
|
2024-02-13 14:20:25 +08:00
|
|
|
- name: Pod Update
|
2021-10-09 16:30:38 +08:00
|
|
|
run: pod repo update --silent
|
|
|
|
|
2024-02-13 14:20:25 +08:00
|
|
|
- name: Pod Install
|
2021-10-09 16:30:38 +08:00
|
|
|
run: pod install
|
|
|
|
|
|
|
|
- name: Run SDWebImage podspec lint
|
|
|
|
run: |
|
|
|
|
set -o pipefail
|
|
|
|
pod lib lint SDWebImage.podspec --allow-warnings --skip-tests
|
2021-10-09 16:40:45 +08:00
|
|
|
|
2024-02-13 14:20:25 +08:00
|
|
|
Demo:
|
|
|
|
name: Cocoapods Demo
|
2024-02-23 16:16:14 +08:00
|
|
|
runs-on: macos-14
|
2021-10-09 16:30:38 +08:00
|
|
|
env:
|
2024-02-13 13:07:53 +08:00
|
|
|
DEVELOPER_DIR: /Applications/Xcode_15.2.app
|
2021-10-09 16:30:38 +08:00
|
|
|
WORKSPACE_NAME: SDWebImage.xcworkspace
|
2024-02-13 13:41:54 +08:00
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
iosDestination: platform=iOS Simulator,name=iPhone 15 Pro
|
|
|
|
macOSDestination: platform=macOS,arch=x86_64
|
|
|
|
macCatalystDestination: platform=macOS,arch=x86_64,variant=Mac Catalyst
|
|
|
|
tvOSDestination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation)
|
|
|
|
watchOSDestination: platform=watchOS Simulator,name=Apple Watch Series 9 (45mm)
|
|
|
|
visionOSDestination: platform=visionOS Simulator,name=Apple Vision Pro
|
2021-10-09 16:30:38 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-01-17 19:50:50 +08:00
|
|
|
uses: actions/checkout@v3
|
2021-10-09 16:30:38 +08:00
|
|
|
|
|
|
|
- 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
|
2024-02-13 13:41:54 +08:00
|
|
|
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "SDWebImage OSX Demo" -destination "${{ env.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
|
2021-10-09 16:30:38 +08:00
|
|
|
|
|
|
|
- name: Run demo for iOS
|
|
|
|
run: |
|
|
|
|
set -o pipefail
|
2024-02-13 13:41:54 +08:00
|
|
|
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "SDWebImage iOS Demo" -destination "${{ env.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
|
2021-10-09 16:30:38 +08:00
|
|
|
|
|
|
|
- name: Run demo for TV
|
|
|
|
run: |
|
|
|
|
set -o pipefail
|
2024-02-13 13:41:54 +08:00
|
|
|
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "SDWebImage TV Demo" -destination "${{ env.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
|
2021-10-09 16:30:38 +08:00
|
|
|
|
|
|
|
- name: Run demo for Watch
|
|
|
|
run: |
|
|
|
|
set -o pipefail
|
2024-02-13 13:41:54 +08:00
|
|
|
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "SDWebImage Watch Demo" -destination "${{ env.watchOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
|
2024-02-13 13:07:53 +08:00
|
|
|
|
|
|
|
- name: Run demo for Vision
|
|
|
|
run: |
|
|
|
|
set -o pipefail
|
2024-02-13 13:41:54 +08:00
|
|
|
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "SDWebImage Vision Demo" -destination "${{ env.visionOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
|
2024-02-13 14:20:25 +08:00
|
|
|
|
|
|
|
Test:
|
|
|
|
name: Unit Test
|
2024-02-23 16:16:14 +08:00
|
|
|
runs-on: macos-14
|
2024-02-13 14:20:25 +08:00
|
|
|
env:
|
|
|
|
DEVELOPER_DIR: /Applications/Xcode_15.2.app
|
|
|
|
WORKSPACE_NAME: SDWebImage.xcworkspace
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
iosDestination: platform=iOS Simulator,name=iPhone 15 Pro
|
|
|
|
macOSDestination: platform=macOS,arch=x86_64
|
|
|
|
macCatalystDestination: platform=macOS,arch=x86_64,variant=Mac Catalyst
|
|
|
|
tvOSDestination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation)
|
|
|
|
watchOSDestination: platform=watchOS Simulator,name=Apple Watch Series 9 (45mm)
|
|
|
|
visionOSDestination: platform=visionOS Simulator,name=Apple Vision Pro
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Install Cocoapods
|
|
|
|
run: gem install cocoapods --no-document --quiet
|
2021-10-09 16:30:38 +08:00
|
|
|
|
2024-02-13 14:20:25 +08:00
|
|
|
- name: Install Xcpretty
|
|
|
|
run: gem install xcpretty --no-document --quiet
|
|
|
|
|
|
|
|
- name: Pod Update
|
|
|
|
run: pod repo update --silent
|
|
|
|
|
|
|
|
- name: Pod Install
|
|
|
|
run: pod install
|
|
|
|
|
2021-10-09 16:30:38 +08:00
|
|
|
- name: Clean DerivedData
|
|
|
|
run: |
|
|
|
|
rm -rf ~/Library/Developer/Xcode/DerivedData/
|
|
|
|
mkdir DerivedData
|
|
|
|
|
2024-02-13 14:20:25 +08:00
|
|
|
- name: Test for iOS
|
2021-10-09 16:30:38 +08:00
|
|
|
run: |
|
|
|
|
set -o pipefail
|
2024-02-13 13:41:54 +08:00
|
|
|
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests iOS" -destination "${{ env.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
|
2021-10-09 16:30:38 +08:00
|
|
|
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/iOS
|
|
|
|
|
2024-02-13 14:20:25 +08:00
|
|
|
- name: Test for macOS
|
2021-10-09 16:30:38 +08:00
|
|
|
run: |
|
|
|
|
set -o pipefail
|
2024-02-13 13:41:54 +08:00
|
|
|
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests Mac" -destination "${{ env.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
|
2021-10-09 16:30:38 +08:00
|
|
|
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/macOS
|
|
|
|
|
2024-02-13 14:20:25 +08:00
|
|
|
- name: Test for tvOS
|
2021-10-09 16:30:38 +08:00
|
|
|
run: |
|
|
|
|
set -o pipefail
|
2024-02-13 13:41:54 +08:00
|
|
|
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests TV" -destination "${{ env.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
|
2021-10-09 16:30:38 +08:00
|
|
|
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/tvOS
|
2024-02-13 13:07:53 +08:00
|
|
|
|
2024-02-13 14:20:25 +08:00
|
|
|
- name: Test for visionOS
|
2024-02-13 13:07:53 +08:00
|
|
|
run: |
|
|
|
|
set -o pipefail
|
2024-02-13 13:41:54 +08:00
|
|
|
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests Vision" -destination "${{ env.visionOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
|
2024-02-13 13:07:53 +08:00
|
|
|
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/visionOS
|
2021-10-09 16:30:38 +08:00
|
|
|
|
|
|
|
- name: Code Coverage
|
|
|
|
run: |
|
|
|
|
set -o pipefail
|
|
|
|
export PATH="/usr/local/opt/curl/bin:$PATH"
|
|
|
|
curl --version
|
2023-02-07 16:13:32 +08:00
|
|
|
bash <(curl -s https://codecov.io/bash) -v -D './DerivedData/macOS' -J '^SDWebImage$' -c -X gcov -F macos
|
|
|
|
bash <(curl -s https://codecov.io/bash) -v -D './DerivedData/iOS' -J '^SDWebImage$' -c -X gcov -F ios
|
|
|
|
bash <(curl -s https://codecov.io/bash) -v -D './DerivedData/tvOS' -J '^SDWebImage$' -c -X gcov -F tvos
|
2024-02-13 13:07:53 +08:00
|
|
|
bash <(curl -s https://codecov.io/bash) -v -D './DerivedData/visionOS' -J '^SDWebImage$' -c -X gcov -F visionos
|
2021-10-09 16:30:38 +08:00
|
|
|
|
|
|
|
Build:
|
|
|
|
name: Build Library
|
2024-02-23 16:16:14 +08:00
|
|
|
runs-on: macos-14
|
2021-10-09 16:30:38 +08:00
|
|
|
env:
|
2024-02-13 13:07:53 +08:00
|
|
|
DEVELOPER_DIR: /Applications/Xcode_15.2.app
|
2021-10-09 16:30:38 +08:00
|
|
|
PROJECT_NAME: SDWebImage.xcodeproj
|
2021-10-09 16:40:45 +08:00
|
|
|
SCHEME_NAME: SDWebImage
|
2021-10-09 16:30:38 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-01-17 19:50:50 +08:00
|
|
|
uses: actions/checkout@v3
|
2021-10-09 16:30:38 +08:00
|
|
|
|
|
|
|
- name: Build the SwiftPM
|
|
|
|
run: |
|
|
|
|
set -o pipefail
|
|
|
|
swift build
|
|
|
|
rm -rf ~/.build
|
|
|
|
|
|
|
|
- name: Build as static library
|
|
|
|
run: |
|
|
|
|
set -o pipefail
|
2024-02-13 13:07:53 +08:00
|
|
|
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "SDWebImage static" -sdk iphonesimulator PLATFORM_NAME=iphonesimulator -configuration Debug | xcpretty -c
|
2021-10-09 16:30:38 +08:00
|
|
|
rm -rf ~/Library/Developer/Xcode/DerivedData/
|
|
|
|
- name: Build as dynamic frameworks
|
|
|
|
run: |
|
|
|
|
set -o pipefail
|
2024-02-13 13:07:53 +08:00
|
|
|
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -sdk macosx -configuration Debug | xcpretty -c
|
|
|
|
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -sdk iphonesimulator PLATFORM_NAME=iphonesimulator -configuration Debug | xcpretty -c
|
|
|
|
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -sdk appletvsimulator -configuration Debug | xcpretty -c
|
|
|
|
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -sdk watchsimulator -configuration Debug | xcpretty -c
|
|
|
|
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -destination "platform=macOS,arch=x86_64,variant=Mac Catalyst" -configuration Debug | xcpretty -c
|
|
|
|
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -sdk xrsimulator -configuration Debug | xcpretty -c
|
2021-10-09 16:30:38 +08:00
|
|
|
rm -rf ~/Library/Developer/Xcode/DerivedData/
|