Skip to content

Commit 0a450d8

Browse files
Merge pull request #6 from SomeRandomiOSDev/Updates
Regenerated project using the latest from https://github.com/SomeRandomiOSDev/ProjectTemplate
2 parents eafb011 + 563e117 commit 0a450d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2015
-747
lines changed

.github/workflows/carthage.yml

+27-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,32 @@
11
name: Carthage
2-
on: [push, workflow_dispatch]
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- '**'
7+
tags-ignore:
8+
- '**'
9+
paths-ignore:
10+
- .gitignore
11+
- LICENSE
12+
- README.md
313

414
jobs:
515
build:
616
name: Build
717
runs-on: macOS-latest
18+
env:
19+
LOGSDIR: /tmp/.keyvalueobservation.carthage/Logs
20+
821
steps:
922
- name: Checkout Code
1023
uses: actions/checkout@v2
1124

25+
- name: Setup Environment
26+
run: |
27+
mkdir -p "$LOGSDIR"
28+
touch "$LOGSDIR/Build.log"
29+
1230
- name: Install Carthage
1331
run: |
1432
brew update
@@ -24,4 +42,11 @@ jobs:
2442
2543
- name: Build
2644
run: |
27-
./scripts/carthage.sh update
45+
./scripts/carthage.sh update --log-path "$LOGSDIR/Build.log"
46+
47+
- name: Upload Logs
48+
uses: actions/upload-artifact@v2
49+
if: always()
50+
with:
51+
name: BuildLog
52+
path: ${{ env.LOGSDIR }}/*.log

.github/workflows/cocoapods.yml

+35-6
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,52 @@
11
name: Cocoapods
2-
on: [push, workflow_dispatch]
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- '**'
7+
tags-ignore:
8+
- '**'
9+
paths-ignore:
10+
- .gitignore
11+
- LICENSE
12+
- README.md
313

414
jobs:
515
lint:
16+
strategy:
17+
matrix:
18+
linttype: [Dynamic, Static]
19+
620
name: Lint
721
runs-on: macOS-latest
22+
env:
23+
LOGSDIR: /tmp/.keyvalueobservation.cocoapods/Logs
24+
LINT_TYPE: ${{ matrix.linttype }}
25+
826
steps:
927
- name: Checkout Code
1028
uses: actions/checkout@v2
1129

30+
- name: Setup Environment
31+
run: |
32+
mkdir -p "$LOGSDIR"
33+
1234
- name: Setup Cocoapods
1335
uses: maxim-lobanov/setup-cocoapods@v1
1436
with:
1537
version: latest
1638

17-
- name: Lint (Dynamic Library)
39+
- name: Lint
1840
run: |
19-
pod lib lint --skip-tests
41+
if [ "$LINT_TYPE" == "Dynamic" ]; then
42+
pod lib lint --verbose 2>&1 | tee "$LOGSDIR/PodLint-$LINT_TYPE.log"
43+
else
44+
pod lib lint --verbose --use-libraries 2>&1 | tee "$LOGSDIR/PodLint-$LINT_TYPE.log"
45+
fi
2046
21-
- name: Lint (Static Library)
22-
run: |
23-
pod lib lint --use-libraries --skip-tests
47+
- name: Upload Logs
48+
uses: actions/upload-artifact@v2
49+
if: always()
50+
with:
51+
name: Logs
52+
path: ${{ env.LOGSDIR }}/*.log
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish CocoaPods
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
publish:
8+
name: Publish CocoaPods
9+
runs-on: macOS-latest
10+
env:
11+
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
12+
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v2
16+
17+
- name: Setup CocoaPods
18+
uses: maxim-lobanov/setup-cocoapods@v1
19+
with:
20+
version: latest
21+
22+
- name: Publish CocoaPod
23+
run: |
24+
pod trunk push KeyValueObservation.podspec

.github/workflows/upload-assets.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
- name: Build
1818
run: |
19-
./scripts/xcframework.sh -output ${TMPDIR}/KeyValueObservation.xcframework
19+
./scripts/xcframework.sh --output ${TMPDIR}/KeyValueObservation.xcframework
2020
2121
- name: Create Zip
2222
run: |

.github/workflows/xcframework.yml

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
name: XCFramework
2-
on: [push, workflow_dispatch]
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- '**'
7+
tags-ignore:
8+
- '**'
9+
paths-ignore:
10+
- .gitignore
11+
- LICENSE
12+
- README.md
313

414
jobs:
515
build:
@@ -14,4 +24,11 @@ jobs:
1424

1525
- name: Build
1626
run: |
17-
./scripts/xcframework.sh -output ${TMPDIR}/KeyValueObservation.xcframework
27+
./scripts/xcframework.sh --build-dir "$TMPDIR"
28+
29+
- name: Upload Logs
30+
uses: actions/upload-artifact@v2
31+
if: always()
32+
with:
33+
name: BuildLogs
34+
path: ${{ env.TMPDIR }}/Logs/*.log

.github/workflows/xcodebuild.yml

+112-14
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,200 @@
11
name: Xcode Project
2-
on: [push, workflow_dispatch]
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- '**'
7+
tags-ignore:
8+
- '**'
9+
paths-ignore:
10+
- .gitignore
11+
- LICENSE
12+
- README.md
313

414
jobs:
515
ios:
616
name: iOS
717
runs-on: macOS-latest
18+
env:
19+
LOGSDIR: /tmp/.keyvalueobservation.xcodebuild/iOS/Logs
820

921
steps:
1022
- name: Checkout Code
1123
uses: actions/checkout@v2
1224

25+
- name: Setup Environment
26+
run: |
27+
mkdir -p "$LOGSDIR"
28+
1329
- name: Build iOS
1430
run: |
15-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=iOS" -configuration Debug
31+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=iOS" -configuration Debug 2>&1 | tee "$LOGSDIR/build-ios.log"
1632
1733
- name: Build iOS Simulator
1834
run: |
19-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=iOS Simulator" -configuration Debug
35+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=iOS Simulator" -configuration Debug 2>&1 | tee "$LOGSDIR/build-iossimulator.log"
2036
2137
- name: Test
2238
run: |
23-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -testPlan "KeyValueObservationTests" -destination "platform=iOS Simulator,name=iPhone 12 Pro Max" -configuration Debug ONLY_ACTIVE_ARCH=YES test
39+
IOS_SIM="$(xcrun simctl list devices available | grep "iPhone [0-9]" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
40+
if [ "${#IOS_SIM}" == "0" ]; then
41+
IOS_SIM = "iPhone 12 Pro" # Fallback Simulator
42+
fi
43+
44+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -testPlan "KeyValueObservationTests" -destination "platform=iOS Simulator,name=$IOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-ios.log"
45+
46+
- name: Upload Logs
47+
uses: actions/upload-artifact@v2
48+
if: always()
49+
with:
50+
name: iOSBuildLogs
51+
path: ${{ env.LOGSDIR }}/*.log
2452

2553
maccatalyst:
2654
name: Mac Catalyst
2755
runs-on: macOS-latest
56+
env:
57+
LOGSDIR: /tmp/.keyvalueobservation.xcodebuild/macCatalyst/Logs
2858

2959
steps:
3060
- name: Checkout Code
3161
uses: actions/checkout@v2
3262

63+
- name: Setup Environment
64+
run: |
65+
mkdir -p "$LOGSDIR"
66+
3367
- name: Build
3468
run: |
35-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Debug
69+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Debug 2>&1 | tee "$LOGSDIR/build-maccatalyst.log"
3670
3771
- name: Test
3872
run: |
39-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -testPlan "KeyValueObservationTests" -destination "platform=macOS,variant=Mac Catalyst" -configuration Debug ONLY_ACTIVE_ARCH=YES test
73+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -testPlan "KeyValueObservationTests" -destination "platform=macOS,variant=Mac Catalyst" -configuration Debug ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-maccatalyst.log"
74+
75+
- name: Upload Logs
76+
uses: actions/upload-artifact@v2
77+
if: always()
78+
with:
79+
name: MacCatalystBuildLogs
80+
path: ${{ env.LOGSDIR }}/*.log
4081

4182
macos:
4283
name: macOS
4384
runs-on: macOS-latest
85+
env:
86+
LOGSDIR: /tmp/.keyvalueobservation.xcodebuild/macOS/Logs
4487

4588
steps:
4689
- name: Checkout Code
4790
uses: actions/checkout@v2
4891

92+
- name: Setup Environment
93+
run: |
94+
mkdir -p "$LOGSDIR"
95+
4996
- name: Build
5097
run: |
51-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation macOS" -destination "generic/platform=macOS" -configuration Debug
98+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation macOS" -destination "generic/platform=macOS" -configuration Debug 2>&1 | tee "$LOGSDIR/build-macos.log"
5299
53100
- name: Test
54101
run: |
55-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation macOS" -testPlan "KeyValueObservation macOS Tests" -configuration Debug -enableCodeCoverage YES test
102+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation macOS" -testPlan "KeyValueObservation macOS Tests" -derivedDataPath ".xcodebuild" -configuration Debug ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-macos.log"
103+
104+
- name: Generate Code Coverage File
105+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
106+
run: |
107+
PROFDATA_FILE="$(find .xcodebuild -name "*.profdata")"
108+
109+
xcrun llvm-cov export --format=lcov --instr-profile="$PROFDATA_FILE" ".xcodebuild/Build/Products/Debug/KeyValueObservationTests.xctest/Contents/MacOS/KeyValueObservationTests" > "./codecov.lcov"
56110
57111
- name: Upload Code Coverage
58112
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
59113
uses: codecov/codecov-action@v2
60114
with:
61115
token: ${{ secrets.CODECOV_TOKEN }}
116+
file: ./codecov.lcov
62117
verbose: true
63118

119+
- name: Upload Logs
120+
uses: actions/upload-artifact@v2
121+
if: always()
122+
with:
123+
name: macOSBuildLogs
124+
path: ${{ env.LOGSDIR }}/*.log
125+
64126
tvos:
65127
name: tvOS
66128
runs-on: macOS-latest
129+
env:
130+
LOGSDIR: /tmp/.keyvalueobservation.xcodebuild/tvOS/Logs
67131

68132
steps:
69133
- name: Checkout Code
70134
uses: actions/checkout@v2
71135

136+
- name: Setup Environment
137+
run: |
138+
mkdir -p "$LOGSDIR"
139+
72140
- name: Build tvOS
73141
run: |
74-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation tvOS" -destination "generic/platform=tvOS" -configuration Debug
142+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation tvOS" -destination "generic/platform=tvOS" -configuration Debug 2>&1 | tee "$LOGSDIR/build-tvos.log"
75143
76144
- name: Build tvOS Simulator
77145
run: |
78-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation tvOS" -destination "generic/platform=tvOS Simulator" -configuration Debug
146+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation tvOS" -destination "generic/platform=tvOS Simulator" -configuration Debug 2>&1 | tee "$LOGSDIR/build-tvossimulator.log"
79147
80148
- name: Test
81149
run: |
82-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation tvOS" -testPlan "KeyValueObservation tvOS Tests" -destination "platform=tvOS Simulator,name=Apple TV 4K" -configuration Debug ONLY_ACTIVE_ARCH=YES test
150+
TVOS_SIM="$(xcrun simctl list devices available | grep "Apple TV" | sort -V | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
151+
if [ "${#TVOS_SIM}" == "0" ]; then
152+
TVOS_SIM = "Apple TV" # Fallback Simulator
153+
fi
154+
155+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation tvOS" -testPlan "KeyValueObservation tvOS Tests" -destination "platform=tvOS Simulator,name=$TVOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-tvos.log"
156+
157+
- name: Upload Logs
158+
uses: actions/upload-artifact@v2
159+
if: always()
160+
with:
161+
name: tvOSBuildLogs
162+
path: ${{ env.LOGSDIR }}/*.log
83163

84164
watchos:
85165
name: watchOS
86166
runs-on: macOS-11
167+
env:
168+
LOGSDIR: /tmp/.keyvalueobservation.xcodebuild/watchOS/Logs
87169

88170
steps:
89171
- name: Checkout Code
90172
uses: actions/checkout@v2
91173

174+
- name: Setup Environment
175+
run: |
176+
mkdir -p "$LOGSDIR"
177+
92178
- name: Build watchOS
93179
run: |
94-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation watchOS" -destination "generic/platform=watchOS" -configuration Debug
180+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation watchOS" -destination "generic/platform=watchOS" -configuration Debug 2>&1 | tee "$LOGSDIR/build-watchos.log"
95181
96182
- name: Build watchOS Simulator
97183
run: |
98-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation watchOS" -destination "generic/platform=watchOS Simulator" -configuration Debug
184+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation watchOS" -destination "generic/platform=watchOS Simulator" -configuration Debug 2>&1 | tee "$LOGSDIR/build-watchossimulator.log"
99185
100186
- name: Test
101187
run: |
102-
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation watchOS" -testPlan "KeyValueObservation watchOS Tests" -destination "platform=watchOS Simulator,name=Apple Watch Series 6 - 44mm" -configuration Debug ONLY_ACTIVE_ARCH=YES test
188+
WATCHOS_SIM="$(xcrun simctl list devices available | grep "Apple Watch" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
189+
if [ "${#WATCHOS_SIM}" == "0" ]; then
190+
WATCHOS_SIM = "Apple Watch Series 6 - 44mm" # Fallback Simulator
191+
fi
192+
193+
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation watchOS" -testPlan "KeyValueObservation watchOS Tests" -destination "platform=watchOS Simulator,name=$WATCHOS_SIM" -configuration Debug ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-watchos.log"
194+
195+
- name: Upload Logs
196+
uses: actions/upload-artifact@v2
197+
if: always()
198+
with:
199+
name: watchOSBuildLogs
200+
path: ${{ env.LOGSDIR }}/*.log

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
KeyValueObservation.xcodeproj/project.xcworkspace
22
KeyValueObservation.xcodeproj/xcuserdata
3+
4+
.xcodebuild
5+
scripts/build

KeyValueObservation.modulemap

-6
This file was deleted.

0 commit comments

Comments
 (0)