diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..0e4f74f --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,100 @@ +name: "SDWebImageWebPCoder 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@v3 + + - 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 SDWebImageWebPCoder podspec lint + run: | + set -o pipefail + pod lib lint SDWebImageWebPCoder.podspec --allow-warnings --skip-tests + + Test: + name: Unit Test + runs-on: macos-11 + env: + DEVELOPER_DIR: /Applications/Xcode_13.2.1.app + WORKSPACE_NAME: SDWebImageWebPCoder.xcworkspace + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + 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@v3 + + - 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: Clean DerivedData + run: | + rm -rf ~/Library/Developer/Xcode/DerivedData/ + mkdir DerivedData + + - name: Test - ${{ matrix.iosDestination }} + run: | + set -o pipefail + xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests iOS" -destination "${{ matrix.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO + mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/iOS + + - name: Test - ${{ matrix.macOSDestination }} + run: | + set -o pipefail + xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests Mac" -destination "${{ matrix.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO + mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/macOS + + - name: Test - ${{ matrix.tvOSDestination }} + run: | + set -o pipefail + xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests TV" -destination "${{ matrix.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO + 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) -v -D './DerivedData/macOS' -J '^SDWebImageWebPCoder$' -c -X gcov -F macos + bash <(curl -s https://codecov.io/bash) -v -D './DerivedData/iOS' -J '^SDWebImageWebPCoder$' -c -X gcov -F ios + bash <(curl -s https://codecov.io/bash) -v -D './DerivedData/tvOS' -J '^SDWebImageWebPCoder$' -c -X gcov -F tvos + diff --git a/SDWebImageWebPCoder/Classes/SDImageWebPCoder.m b/SDWebImageWebPCoder/Classes/SDImageWebPCoder.m index 3ce4cd3..db308c7 100644 --- a/SDWebImageWebPCoder/Classes/SDImageWebPCoder.m +++ b/SDWebImageWebPCoder/Classes/SDImageWebPCoder.m @@ -763,7 +763,6 @@ static inline CGContextRef _Nullable CreateWebPCanvas(BOOL hasAlpha, CGSize canv !WebPPictureInit(&picture)) { // shouldn't happen, except if system installation is broken free(dest.data); -// CFRelease(dataRef); return nil; }