Skip to content

Commit 5b3ac17

Browse files
authored
CI - Fix github test action (#651)
* Remove duplicate iOS-legacy test.yml job * Makefile fix test scheme name * Add xcscheme to HeroExamples for XCode test action * Updated SwiftUIMatchExample.swift to import Hero * Update project to weak_link Combine and SwiftUI Fixes “/System/Library/Frameworks/SwiftUI.framework/SwiftUI: mach-o, but not built for iOS simulator” * Update test.yml newer XCode and iOS 13 versions * Test.yml add Podfile.lock * Update test.yml fix iOS version numbs * Weak link SwiftUI.framework resolve ci compile issue maybe * github action test swiftpm * test.yml update iOS versions for current ver test * github test action non-parallel, config Debug Signed-off-by: Joe Mattiello <mail@joemattiello.com> * github actions tvos only active arch Signed-off-by: Joe Mattiello <mail@joemattiello.com> * Makefile make test for sim not device Signed-off-by: Joe Mattiello <mail@joemattiello.com>
1 parent 1f0cfa9 commit 5b3ac17

File tree

6 files changed

+200
-63
lines changed

6 files changed

+200
-63
lines changed

.github/workflows/test.yml

Lines changed: 42 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Unit Test
22

3-
on:
3+
on:
44
pull_request:
55
paths:
66
- "**.swift"
@@ -9,94 +9,82 @@ on:
99
- "**.h"
1010
- "**.podspec"
1111
- "Podfile"
12+
- "Podfile.lock"
1213
- "test.yml"
1314
jobs:
14-
iOS:
15-
name: Test iOS
15+
swiftpm:
16+
name: Test iOS (swiftpm)
1617
runs-on: macOS-latest
1718
env:
18-
DEVELOPER_DIR: /Applications/Xcode_11.1.app/Contents/Developer
19-
strategy:
20-
matrix:
21-
destination: [
22-
'platform=iOS Simulator,OS=13.1,name=iPhone 11'
23-
]
19+
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
2420
steps:
2521
- name: Checkout
2622
uses: actions/checkout@master
27-
- name: iOS - ${{ matrix.destination }}
23+
- name: iOS - Swift PM
2824
run: |
2925
pod install
30-
set -o pipefail && xcodebuild clean test -workspace Hero.xcworkspace -scheme Hero -destination "${destination}" -parallelizeTargets -showBuildTimingSummary -enableThreadSanitizer YES -enableCodeCoverage YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO | xcpretty
31-
bash <(curl -s https://codecov.io/bash)
32-
env:
33-
destination: ${{ matrix.destination }}
34-
- name: Upload Code Coverage
35-
run: |
36-
bash <(curl -s https://codecov.io/bash)
37-
env:
38-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
39-
iOS-legacy:
26+
set -o pipefail && swift test --parallel
27+
iOS:
4028
name: Test iOS
4129
runs-on: macOS-latest
4230
env:
43-
DEVELOPER_DIR: /Applications/Xcode_11.1.app/Contents/Developer
31+
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
4432
strategy:
4533
matrix:
4634
destination: [
47-
'platform=iOS Simulator,OS=10.3.1,name=iPhone 7'
35+
'platform=iOS Simulator,OS=14.4,name=iPhone 12'
4836
]
4937
steps:
5038
- name: Checkout
5139
uses: actions/checkout@master
40+
5241
- name: iOS - ${{ matrix.destination }}
5342
run: |
54-
xcversion simulators --install='iOS 10.3.1'
5543
pod install
56-
set -o pipefail && xcodebuild clean test -workspace Hero.xcworkspace -scheme Hero -destination "${destination}" -parallelizeTargets -showBuildTimingSummary -enableThreadSanitizer YES -enableCodeCoverage YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO | xcpretty
57-
bash <(curl -s https://codecov.io/bash)
58-
env:
59-
destination: ${{ matrix.destination }}
60-
- name: Upload Code Coverage
61-
run: |
44+
set -o pipefail && xcodebuild clean test -workspace Hero.xcworkspace -scheme Hero -destination "${destination}" -configuration "Debug" -showBuildTimingSummary -enableThreadSanitizer YES -enableCodeCoverage YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | xcpretty
6245
bash <(curl -s https://codecov.io/bash)
6346
env:
64-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
65-
iOS-legacy:
66-
name: Test iOS
67-
runs-on: macOS-latest
68-
env:
69-
DEVELOPER_DIR: /Applications/Xcode_11.1.app/Contents/Developer
70-
strategy:
71-
matrix:
72-
destination: [
73-
'platform=iOS Simulator,OS=10.3.1,name=iPhone 7'
74-
]
75-
steps:
76-
- name: Checkout
77-
uses: actions/checkout@master
78-
- name: iOS - ${{ matrix.destination }}
79-
run: |
80-
xcversion simulators --install='iOS 10.3.1'
81-
pod install
82-
set -o pipefail && xcodebuild clean test -workspace Hero.xcworkspace -scheme Hero -destination "${destination}" -parallelizeTargets -showBuildTimingSummary -enableThreadSanitizer YES -enableCodeCoverage YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO | xcpretty
83-
bash <(curl -s https://codecov.io/bash)
84-
env:
8547
destination: ${{ matrix.destination }}
8648
- name: Upload Code Coverage
8749
run: |
8850
bash <(curl -s https://codecov.io/bash)
8951
env:
9052
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
53+
# iOS-legacy:
54+
# name: Test iOS
55+
# runs-on: macOS-latest
56+
# env:
57+
# DEVELOPER_DIR: /Applications/Xcode_10.3.1.app/Contents/Developer
58+
# strategy:
59+
# matrix:
60+
# destination: [
61+
# 'platform=iOS Simulator,OS=10.3.1,name=iPhone 7'
62+
# ]
63+
# steps:
64+
# - name: Checkout
65+
# uses: actions/checkout@master
66+
# - name: iOS - ${{ matrix.destination }}
67+
# run: |
68+
# xcversion simulators --install='iOS 10.3.1'
69+
# pod install
70+
# set -o pipefail && xcodebuild clean test -workspace Hero.xcworkspace -scheme Hero -destination "${destination}" -parallelizeTargets -showBuildTimingSummary -enableThreadSanitizer YES -enableCodeCoverage YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO | xcpretty
71+
# bash <(curl -s https://codecov.io/bash)
72+
# env:
73+
# destination: ${{ matrix.destination }}
74+
# - name: Upload Code Coverage
75+
# run: |
76+
# bash <(curl -s https://codecov.io/bash)
77+
# env:
78+
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
9179
tvOS:
9280
name: Test tvOS
9381
runs-on: macOS-latest
9482
env:
95-
DEVELOPER_DIR: /Applications/Xcode_11.1.app/Contents/Developer
83+
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
9684
strategy:
9785
matrix:
9886
destination: [
99-
'platform=tvOS Simulator,OS=13.0,name=Apple TV 4K'
87+
'platform=tvOS Simulator,OS=14.3,name=Apple TV 4K'
10088
]
10189

10290
steps:
@@ -105,6 +93,6 @@ jobs:
10593
- name: tvOS - ${{ matrix.destination }}
10694
run: |
10795
pod install
108-
set -o pipefail && xcodebuild clean build -workspace Hero.xcworkspace -scheme "Hero (tvOS)" -destination "${destination}" -parallelizeTargets -showBuildTimingSummary -enableThreadSanitizer YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=NO | xcpretty
109-
env:
96+
set -o pipefail && xcodebuild clean build -workspace Hero.xcworkspace -scheme "Hero (tvOS)" -destination "${destination}" -parallelizeTargets -showBuildTimingSummary -enableThreadSanitizer YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | xcpretty
97+
env:
11098
destination: ${{ matrix.destination }}

.makefiles/ios.mk

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pre_setup:
9090
check_for_ruby:
9191
$(info Checking for Ruby ...)
9292

93-
ifeq ($(RUBY),)
93+
ifeq ($(RUBY),)
9494
$(error Ruby is not installed)
9595
endif
9696

@@ -109,7 +109,7 @@ update_homebrew:
109109
install_swift_lint:
110110
$(info Install swiftlint ...)
111111

112-
ifneq ($(SWIFTLINT),)
112+
ifneq ($(SWIFTLINT),)
113113
brew install swiftlint
114114
else
115115
$(info Already have, skipping.)
@@ -132,7 +132,7 @@ install_ruby_gems:
132132
install_carthage:
133133
$(info Install Carthage ...)
134134

135-
ifneq ($(CARTHAGE),)
135+
ifneq ($(CARTHAGE),)
136136
brew install carthage
137137
else
138138
$(info Already have, skipping.)
@@ -141,7 +141,7 @@ endif
141141
install_carting:
142142
$(info Install Carting ...)
143143

144-
ifneq ($(CARTING),)
144+
ifneq ($(CARTING),)
145145
brew install artemnovichkov/projects/carting
146146
else
147147
$(info Already have, skipping.)
@@ -150,7 +150,7 @@ endif
150150
install_swiftgen:
151151
$(info Install Swift-Gen (https://github.com/SwiftGen/SwiftGen) ...)
152152

153-
ifneq ($(SWIFTGEN),)
153+
ifneq ($(SWIFTGEN),)
154154
brew install swiftgen
155155
else
156156
$(info Already have, skipping.)
@@ -160,7 +160,7 @@ gitpull:
160160
$(info Pulling new commits ...)
161161

162162
git pull
163-
163+
164164
#> -- QA Task Runners --
165165

166166
codecov_upload:
@@ -170,7 +170,7 @@ codecov_upload:
170170
danger_pr:
171171
bundle exec danger pr "$(GITHUB_URL:/=)/pull/$(PULL)"
172172

173-
danger:
173+
danger:
174174
bundle exec danger
175175

176176
#> SwiftLint autocorrect
@@ -181,7 +181,7 @@ autocorrect:
181181

182182
#> Run test on all targets
183183
test:
184-
xcodebuild test -scheme $(TEST_SCHEME) -workspace $(WORKSPACE) | tee xcodebuild.log | xcpretty
184+
xcodebuild test -scheme $(TEST_SCHEME) -workspace $(WORKSPACE) -destination 'platform=iOS Simulator,OS=14.4,name=iPhone 12' -parallelizeTargets -showBuildTimingSummary -enableThreadSanitizer YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO ONLY_ACTIVE_ARCH=YES | tee xcodebuild.log | xcpretty
185185

186186
#> -- Building --
187187

Examples/SwiftUIMatchExample.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import UIKit
44
import SwiftUI
5+
import Hero
56

67
@available(iOS 13.0, *)
78
class SwiftUIMatchExampleViewController: UIHostingController<ImagesTableView> {

Hero.xcodeproj/project.pbxproj

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@
130130
B1D834051F02E7C0009E1E36 /* ConditionalPreprocessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1D834031F02E7C0009E1E36 /* ConditionalPreprocessor.swift */; };
131131
B35264CE2454FEF300D33861 /* Locale+Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = B35264CD2454FEF300D33861 /* Locale+Hero.swift */; };
132132
B35264CF2454FEF300D33861 /* Locale+Hero.swift in Sources */ = {isa = PBXBuildFile; fileRef = B35264CD2454FEF300D33861 /* Locale+Hero.swift */; };
133+
B383074925D1041A00B7A0D8 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B383074825D1041A00B7A0D8 /* SwiftUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
134+
B383074B25D1042C00B7A0D8 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B383074A25D1042C00B7A0D8 /* SwiftUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
133135
DBA05BB41A704A4A17967918 /* Pods_HeroTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 841FFA357ACB279D3F74CDEE /* Pods_HeroTests.framework */; };
134136
F482F0BE235D7808002E97ED /* UIColor+HexString.swift in Sources */ = {isa = PBXBuildFile; fileRef = F482F0BD235D7808002E97ED /* UIColor+HexString.swift */; };
135137
F482F0BF235D7808002E97ED /* UIColor+HexString.swift in Sources */ = {isa = PBXBuildFile; fileRef = F482F0BD235D7808002E97ED /* UIColor+HexString.swift */; };
@@ -288,6 +290,8 @@
288290
B1D816EA1EF5A720007B9776 /* HeroTransition+Animate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "HeroTransition+Animate.swift"; sourceTree = "<group>"; };
289291
B1D834031F02E7C0009E1E36 /* ConditionalPreprocessor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConditionalPreprocessor.swift; sourceTree = "<group>"; };
290292
B35264CD2454FEF300D33861 /* Locale+Hero.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Locale+Hero.swift"; sourceTree = "<group>"; };
293+
B383074825D1041A00B7A0D8 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
294+
B383074A25D1042C00B7A0D8 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS14.3.sdk/System/Library/Frameworks/SwiftUI.framework; sourceTree = DEVELOPER_DIR; };
291295
C377744CBFF1E24426E80F55 /* Pods-HeroExamples.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HeroExamples.release.xcconfig"; path = "Pods/Target Support Files/Pods-HeroExamples/Pods-HeroExamples.release.xcconfig"; sourceTree = "<group>"; };
292296
C51A6465EC2CB38D82F28B93 /* Pods-HeroTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HeroTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-HeroTests/Pods-HeroTests.debug.xcconfig"; sourceTree = "<group>"; };
293297
EEE340F89FF0A49DD23A5A6E /* Pods_HeroExamples.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HeroExamples.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -309,6 +313,7 @@
309313
buildActionMask = 2147483647;
310314
files = (
311315
2D1F7FF21E49E043004D944B /* Hero.framework in Frameworks */,
316+
B383074B25D1042C00B7A0D8 /* SwiftUI.framework in Frameworks */,
312317
A355CEC8D787CF71B0D7CBDA /* Pods_HeroTvOSExamples.framework in Frameworks */,
313318
);
314319
runOnlyForDeploymentPostprocessing = 0;
@@ -325,6 +330,7 @@
325330
buildActionMask = 2147483647;
326331
files = (
327332
A306D3B91E1C7A2E00B6C23A /* Hero.framework in Frameworks */,
333+
B383074925D1041A00B7A0D8 /* SwiftUI.framework in Frameworks */,
328334
83043017B73BC66DBB920D5C /* Pods_HeroExamples.framework in Frameworks */,
329335
);
330336
runOnlyForDeploymentPostprocessing = 0;
@@ -343,6 +349,8 @@
343349
0ED3C727BC790F37EE7BD698 /* Frameworks */ = {
344350
isa = PBXGroup;
345351
children = (
352+
B383074825D1041A00B7A0D8 /* SwiftUI.framework */,
353+
B383074A25D1042C00B7A0D8 /* SwiftUI.framework */,
346354
EEE340F89FF0A49DD23A5A6E /* Pods_HeroExamples.framework */,
347355
FD2306FDA4E15ADA91EFED44 /* Pods_HeroTvOSExamples.framework */,
348356
841FFA357ACB279D3F74CDEE /* Pods_HeroTests.framework */,
@@ -1479,6 +1487,19 @@
14791487
"@executable_path/Frameworks",
14801488
);
14811489
MARKETING_VERSION = 1.6.0;
1490+
OTHER_LDFLAGS = (
1491+
"$(inherited)",
1492+
"-framework",
1493+
"\"CollectionKit\"",
1494+
"-framework",
1495+
"\"Foundation\"",
1496+
"-framework",
1497+
"\"UIKit\"",
1498+
"-weak_framework",
1499+
SwiftUI,
1500+
"-weak_framework",
1501+
Combine,
1502+
);
14821503
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroExamples;
14831504
PRODUCT_NAME = "$(TARGET_NAME)";
14841505
SWIFT_VERSION = 5.0;
@@ -1499,6 +1520,19 @@
14991520
"@executable_path/Frameworks",
15001521
);
15011522
MARKETING_VERSION = 1.6.0;
1523+
OTHER_LDFLAGS = (
1524+
"$(inherited)",
1525+
"-framework",
1526+
"\"CollectionKit\"",
1527+
"-framework",
1528+
"\"Foundation\"",
1529+
"-framework",
1530+
"\"UIKit\"",
1531+
"-weak_framework",
1532+
SwiftUI,
1533+
"-weak_framework",
1534+
Combine,
1535+
);
15021536
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroExamples;
15031537
PRODUCT_NAME = "$(TARGET_NAME)";
15041538
SWIFT_VERSION = 5.0;
@@ -1520,6 +1554,19 @@
15201554
"@executable_path/Frameworks",
15211555
"@loader_path/Frameworks",
15221556
);
1557+
OTHER_LDFLAGS = (
1558+
"$(inherited)",
1559+
"-framework",
1560+
"\"CollectionKit\"",
1561+
"-framework",
1562+
"\"Foundation\"",
1563+
"-framework",
1564+
"\"UIKit\"",
1565+
"-weak_framework",
1566+
Combine,
1567+
"-weak_framework",
1568+
SwiftUI,
1569+
);
15231570
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroTests;
15241571
PRODUCT_NAME = "$(TARGET_NAME)";
15251572
SWIFT_VERSION = 5.0;
@@ -1541,6 +1588,19 @@
15411588
"@executable_path/Frameworks",
15421589
"@loader_path/Frameworks",
15431590
);
1591+
OTHER_LDFLAGS = (
1592+
"$(inherited)",
1593+
"-framework",
1594+
"\"CollectionKit\"",
1595+
"-framework",
1596+
"\"Foundation\"",
1597+
"-framework",
1598+
"\"UIKit\"",
1599+
"-weak_framework",
1600+
Combine,
1601+
"-weak_framework",
1602+
SwiftUI,
1603+
);
15441604
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroTests;
15451605
PRODUCT_NAME = "$(TARGET_NAME)";
15461606
SWIFT_VERSION = 5.0;

0 commit comments

Comments
 (0)