Skip to content

Commit 3df5355

Browse files
committed
Added GitHub actions
1 parent 9082448 commit 3df5355

File tree

2 files changed

+100
-1
lines changed

2 files changed

+100
-1
lines changed

.github/workflows/CI.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: "SDWebImageWebPCoder CI"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
Pods:
16+
name: Cocoapods Lint
17+
runs-on: macos-11
18+
env:
19+
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
- name: Install Cocoapods
25+
run: gem install cocoapods --no-document --quiet
26+
27+
- name: Install Xcpretty
28+
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
35+
36+
- name: Run SDWebImageWebPCoder podspec lint
37+
run: |
38+
set -o pipefail
39+
pod lib lint SDWebImageWebPCoder.podspec --allow-warnings --skip-tests
40+
41+
Test:
42+
name: Unit Test
43+
runs-on: macos-11
44+
env:
45+
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
46+
WORKSPACE_NAME: SDWebImageWebPCoder.xcworkspace
47+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
48+
strategy:
49+
matrix:
50+
iosDestination: ["platform=iOS Simulator,name=iPhone 13 Pro"]
51+
macOSDestination: ["platform=macOS,arch=x86_64"]
52+
tvOSDestination: ["platform=tvOS Simulator,name=Apple TV 4K"]
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v3
56+
57+
- name: Install Cocoapods
58+
run: gem install cocoapods --no-document --quiet
59+
60+
- name: Install Xcpretty
61+
run: gem install xcpretty --no-document --quiet
62+
63+
- name: Pod Update
64+
run: pod repo update --silent
65+
66+
- name: Pod Install
67+
run: pod install
68+
69+
- name: Clean DerivedData
70+
run: |
71+
rm -rf ~/Library/Developer/Xcode/DerivedData/
72+
mkdir DerivedData
73+
74+
- name: Test - ${{ matrix.iosDestination }}
75+
run: |
76+
set -o pipefail
77+
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests iOS" -destination "${{ matrix.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
78+
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/iOS
79+
80+
- name: Test - ${{ matrix.macOSDestination }}
81+
run: |
82+
set -o pipefail
83+
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests Mac" -destination "${{ matrix.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
84+
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/macOS
85+
86+
- name: Test - ${{ matrix.tvOSDestination }}
87+
run: |
88+
set -o pipefail
89+
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests TV" -destination "${{ matrix.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
90+
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/tvOS
91+
92+
- name: Code Coverage
93+
run: |
94+
set -o pipefail
95+
export PATH="/usr/local/opt/curl/bin:$PATH"
96+
curl --version
97+
bash <(curl -s https://codecov.io/bash) -v -D './DerivedData/macOS' -J '^SDWebImageWebPCoder$' -c -X gcov -F macos
98+
bash <(curl -s https://codecov.io/bash) -v -D './DerivedData/iOS' -J '^SDWebImageWebPCoder$' -c -X gcov -F ios
99+
bash <(curl -s https://codecov.io/bash) -v -D './DerivedData/tvOS' -J '^SDWebImageWebPCoder$' -c -X gcov -F tvos
100+

SDWebImageWebPCoder/Classes/SDImageWebPCoder.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,6 @@ - (nullable NSData *)sd_encodedWebpDataWithImage:(nullable CGImageRef)imageRef
763763
!WebPPictureInit(&picture)) {
764764
// shouldn't happen, except if system installation is broken
765765
free(dest.data);
766-
// CFRelease(dataRef);
767766
return nil;
768767
}
769768

0 commit comments

Comments
 (0)