Skip to content

Commit 33bede0

Browse files
authored
Use make commands on the CI so it actually fails (#286)
* Use make commands * Fix tests * Rename 'lint' make command to 'cocoapods'
1 parent 37831e4 commit 33bede0

File tree

3 files changed

+23
-30
lines changed

3 files changed

+23
-30
lines changed

.github/workflows/ci.yaml

+14-21
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,34 @@ on:
1111
- master
1212

1313
jobs:
14-
build:
15-
name: Build
14+
test:
15+
name: Test
1616
runs-on: macOS-latest
1717
strategy:
1818
matrix:
1919
platform: ['iOS Simulator,name=iPhone 8']
2020
steps:
2121
- uses: actions/checkout@v1
22-
- name: Analyze and Test
23-
run: |
24-
xcodebuild clean analyze test \
25-
-destination "platform=${{ matrix.platform }}" \
26-
-sdk "iphonesimulator" \
27-
-project PINCache.xcodeproj \
28-
-scheme PINCache \
29-
ONLY_ACTIVE_ARCH=NO \
30-
CODE_SIGNING_REQUIRED=NO \
31-
CLANG_ANALYZER_OUTPUT=plist-html \
32-
CLANG_ANALYZER_OUTPUT_DIR="$(pwd)/clang" \
33-
| xcpretty
34-
if [[ -n `find $(pwd)/clang -name "*.html"` ]] ; then rm -rf $(pwd)/clang; exit 1; fi
35-
rm -rf $(pwd)/clang
22+
- name: Test
23+
run: make test
24+
analyze:
25+
name: Analyze
26+
runs-on: macOS-latest
27+
steps:
28+
- uses: actions/checkout@v1
29+
- name: analyze
30+
run: make analyze
3631
cocoapods:
3732
name: CocoaPods
3833
runs-on: macOS-latest
3934
steps:
4035
- uses: actions/checkout@v1
4136
- name: Lint
42-
run: pod lib lint
37+
run: make cocoapods
4338
carthage:
4439
name: Carthage
4540
runs-on: macOS-latest
4641
steps:
4742
- uses: actions/checkout@v1
48-
- name: Update
49-
run: carthage update --no-use-binaries --no-build
50-
- name: Build
51-
run: carthage build --no-skip-current
43+
- name: carthage
44+
run: make carthage

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ PLATFORM="platform=iOS Simulator,name=iPhone 8"
22
SDK="iphonesimulator"
33
SHELL=/bin/bash -o pipefail
44

5-
.PHONY: all lint test carthage analyze
5+
.PHONY: all cocoapods test carthage analyze
66

7-
lint:
7+
cocoapods:
88
pod lib lint
99

1010
analyze:
@@ -25,4 +25,4 @@ carthage:
2525
carthage update --no-use-binaries --no-build
2626
carthage build --no-skip-current
2727

28-
all: carthage lint test analyze
28+
all: carthage cocoapods test analyze

Tests/PINCacheTests.m

+6-6
Original file line numberDiff line numberDiff line change
@@ -735,13 +735,13 @@ - (void)testAgeLimit
735735
}];
736736

737737
dispatch_group_enter(group);
738-
[self.cache.diskCache objectForKeyAsync:key1 completion:^(id<PINCaching> cache, NSString *key, id<NSCoding> object) {
738+
[self.cache.diskCache objectForKeyAsync:key1 completion:^(PINDiskCache * _Nonnull cache, NSString * _Nonnull key, id<NSCoding> _Nullable object) {
739739
diskObj1 = object;
740740
dispatch_group_leave(group);
741741
}];
742742

743743
dispatch_group_enter(group);
744-
[self.cache.diskCache objectForKeyAsync:key2 completion:^(id<PINCaching> cache, NSString *key, id<NSCoding> object) {
744+
[self.cache.diskCache objectForKeyAsync:key2 completion:^(PINDiskCache * _Nonnull cache, NSString * _Nonnull key, id<NSCoding> _Nullable object) {
745745
diskObj2 = object;
746746
dispatch_group_leave(group);
747747
}];
@@ -778,13 +778,13 @@ - (void)testAgeLimit
778778
}];
779779

780780
dispatch_group_enter(group);
781-
[self.cache.diskCache objectForKeyAsync:key1 completion:^(id<PINCaching> cache, NSString *key, id<NSCoding> object) {
781+
[self.cache.diskCache objectForKeyAsync:key1 completion:^(PINDiskCache * _Nonnull cache, NSString * _Nonnull key, id<NSCoding> _Nullable object) {
782782
diskObj1 = object;
783783
dispatch_group_leave(group);
784784
}];
785785

786786
dispatch_group_enter(group);
787-
[self.cache.diskCache objectForKeyAsync:key2 completion:^(PINDiskCache *cache, NSString *key, id<NSCoding> object) {
787+
[self.cache.diskCache objectForKeyAsync:key2 completion:^(PINDiskCache * _Nonnull cache, NSString * _Nonnull key, id<NSCoding> _Nullable object) {
788788
diskObj2 = object;
789789
dispatch_group_leave(group);
790790
}];
@@ -909,7 +909,7 @@ - (void)_testTTLCacheObjectAccess {
909909
}];
910910

911911
dispatch_group_enter(group);
912-
[self.cache.diskCache objectForKeyAsync:key completion:^(id<PINCaching> cache, NSString *key, id<NSCoding> object) {
912+
[self.cache.diskCache objectForKeyAsync:key completion:^(PINDiskCache * _Nonnull cache, NSString * _Nonnull key, id<NSCoding> _Nullable object) {
913913
diskObj = object;
914914
dispatch_group_leave(group);
915915
}];
@@ -933,7 +933,7 @@ - (void)_testTTLCacheObjectAccess {
933933
}];
934934

935935
dispatch_group_enter(group);
936-
[self.cache.diskCache objectForKeyAsync:key completion:^(id<PINCaching> cache, NSString *key, id<NSCoding> object) {
936+
[self.cache.diskCache objectForKeyAsync:key completion:^(PINDiskCache * _Nonnull cache, NSString * _Nonnull key, id<NSCoding> _Nullable object) {
937937
diskObj = object;
938938
dispatch_group_leave(group);
939939
}];

0 commit comments

Comments
 (0)