Fix the CI action and test cases

This commit is contained in:
DreamPiggy 2023-06-14 17:23:29 +08:00
parent ba6fae4d7d
commit 1d982f6c75
4 changed files with 8 additions and 21 deletions

View File

@ -74,27 +74,13 @@ jobs:
- name: Test - ${{ matrix.iosDestination }} - name: Test - ${{ matrix.iosDestination }}
run: | run: |
set -o pipefail set -o pipefail
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests iOS" -destination "${{ matrix.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "SDWebImageWebPCoderTests" -destination "${{ matrix.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/iOS 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 - name: Code Coverage
run: | run: |
set -o pipefail set -o pipefail
export PATH="/usr/local/opt/curl/bin:$PATH" export PATH="/usr/local/opt/curl/bin:$PATH"
curl --version 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/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

View File

@ -8,7 +8,6 @@ target 'SDWebImageWebPCoderExample' do
platform :ios, '9.0' platform :ios, '9.0'
project example_project_path project example_project_path
pod 'SDWebImageWebPCoder', :path => './' pod 'SDWebImageWebPCoder', :path => './'
pod 'SDWebImage', :path => '../SDWebImage'
end end
target 'SDWebImageWebPCoderTests' do target 'SDWebImageWebPCoderTests' do
@ -16,5 +15,4 @@ target 'SDWebImageWebPCoderTests' do
project test_project_path project test_project_path
pod 'Expecta' pod 'Expecta'
pod 'SDWebImageWebPCoder', :path => './' pod 'SDWebImageWebPCoder', :path => './'
pod 'SDWebImage', :path => '../SDWebImage'
end end

View File

@ -129,6 +129,9 @@ const int64_t kAsyncTestTimeout = 5;
XCTestExpectation *expectation = [self expectationWithDescription:@"test SDAnimatedImageView view category"]; XCTestExpectation *expectation = [self expectationWithDescription:@"test SDAnimatedImageView view category"];
SDAnimatedImageView *imageView = [SDAnimatedImageView new]; SDAnimatedImageView *imageView = [SDAnimatedImageView new];
NSURL *testURL = [NSURL URLWithString:@"http://littlesvr.ca/apng/images/SteamEngine.webp"]; NSURL *testURL = [NSURL URLWithString:@"http://littlesvr.ca/apng/images/SteamEngine.webp"];
NSString *key = [SDWebImageManager.sharedManager cacheKeyForURL:testURL];
[SDImageCache.sharedImageCache removeImageFromMemoryForKey:key];
[SDImageCache.sharedImageCache removeImageFromDiskForKey:key];
[imageView sd_setImageWithURL:testURL placeholderImage:nil options:SDWebImageProgressiveLoad progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) { [imageView sd_setImageWithURL:testURL placeholderImage:nil options:SDWebImageProgressiveLoad progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
UIImage *image = imageView.image; UIImage *image = imageView.image;

View File

@ -284,8 +284,8 @@
PRODUCT_NAME = SDWebImageWebPCoder; PRODUCT_NAME = SDWebImageWebPCoder;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos";
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2,3,4";
TVOS_DEPLOYMENT_TARGET = 9.0; TVOS_DEPLOYMENT_TARGET = 9.0;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = ""; VERSION_INFO_PREFIX = "";
@ -358,8 +358,8 @@
PRODUCT_NAME = SDWebImageWebPCoder; PRODUCT_NAME = SDWebImageWebPCoder;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos";
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2,3,4";
TVOS_DEPLOYMENT_TARGET = 9.0; TVOS_DEPLOYMENT_TARGET = 9.0;
VALIDATE_PRODUCT = YES; VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";