Skip to content

Refactor WebImage/AnimatedImage using SwiftUIBackports and StateObject #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
187 changes: 187 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
name: "SDWebImageSwiftUI CI"

on:
push:
branches:
- master
pull_request:
branches:
- '*'

permissions:
contents: read

jobs:
Pods:
name: Cocoapods Lint
runs-on: macos-11
env:
DEVELOPER_DIR: /Applications/Xcode_13.2.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-11
env:
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
WORKSPACE_NAME: SDWebImageSwiftUI.xcworkspace
OSXSCHEME: SDWebImageSwiftUIDemo-macOS
iOSSCHEME: SDWebImageSwiftUIDemo
TVSCHEME: SDWebImageSwiftUIDemo-tvOS
WATCHSCHEME: SDWebImageSwiftUIDemo-watchOS WatchKit App
strategy:
matrix:
iosDestination: ["name=iPhone 13 Pro"]
tvOSDestination: ["name=Apple TV 4K"]
watchOSDestination: ["platform=watchOS Simulator,name=Apple Watch Series 7 - 45mm"]
macOSDestination: ["platform=macOS"]
macCatalystDestination: ["platform=macOS,arch=x86_64,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-11
env:
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
WORKSPACE_NAME: SDWebImageSwiftUI.xcworkspace
OSXSCHEME: SDWebImageSwiftUITests macOS
iOSSCHEME: SDWebImageSwiftUITests
TVSCHEME: SDWebImageSwiftUITests tvOS
strategy:
matrix:
iosDestination: ["platform=iOS Simulator,name=iPhone 13 Pro"]
macOSDestination: ["platform=macOS,arch=x86_64"]
tvOSDestination: ["platform=tvOS Simulator,name=Apple TV 4K"]
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 | xcpretty -c
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-11
env:
DEVELOPER_DIR: /Applications/Xcode_13.2.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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ Podfile.lock
# SwiftPM
.build
.swiftpm
Package.resolved
28 changes: 0 additions & 28 deletions Example/Podfile

This file was deleted.

Loading