Skip to content

Commit

Permalink
Merge pull request #6 from SomeRandomiOSDev/Updates
Browse files Browse the repository at this point in the history
Regenerated project using the latest from https://github.com/SomeRandomiOSDev/ProjectTemplate
  • Loading branch information
SomeRandomiOSDev authored Nov 6, 2021
2 parents eafb011 + 563e117 commit 0a450d8
Show file tree
Hide file tree
Showing 48 changed files with 2,015 additions and 747 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/carthage.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
name: Carthage
on: [push, workflow_dispatch]
on:
workflow_dispatch:
push:
branches:
- '**'
tags-ignore:
- '**'
paths-ignore:
- .gitignore
- LICENSE
- README.md

jobs:
build:
name: Build
runs-on: macOS-latest
env:
LOGSDIR: /tmp/.keyvalueobservation.carthage/Logs

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
touch "$LOGSDIR/Build.log"
- name: Install Carthage
run: |
brew update
Expand All @@ -24,4 +42,11 @@ jobs:
- name: Build
run: |
./scripts/carthage.sh update
./scripts/carthage.sh update --log-path "$LOGSDIR/Build.log"
- name: Upload Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: BuildLog
path: ${{ env.LOGSDIR }}/*.log
41 changes: 35 additions & 6 deletions .github/workflows/cocoapods.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,52 @@
name: Cocoapods
on: [push, workflow_dispatch]
on:
workflow_dispatch:
push:
branches:
- '**'
tags-ignore:
- '**'
paths-ignore:
- .gitignore
- LICENSE
- README.md

jobs:
lint:
strategy:
matrix:
linttype: [Dynamic, Static]

name: Lint
runs-on: macOS-latest
env:
LOGSDIR: /tmp/.keyvalueobservation.cocoapods/Logs
LINT_TYPE: ${{ matrix.linttype }}

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Setup Cocoapods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: latest

- name: Lint (Dynamic Library)
- name: Lint
run: |
pod lib lint --skip-tests
if [ "$LINT_TYPE" == "Dynamic" ]; then
pod lib lint --verbose 2>&1 | tee "$LOGSDIR/PodLint-$LINT_TYPE.log"
else
pod lib lint --verbose --use-libraries 2>&1 | tee "$LOGSDIR/PodLint-$LINT_TYPE.log"
fi
- name: Lint (Static Library)
run: |
pod lib lint --use-libraries --skip-tests
- name: Upload Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: Logs
path: ${{ env.LOGSDIR }}/*.log
24 changes: 24 additions & 0 deletions .github/workflows/publish-cocoapods.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish CocoaPods
on:
release:
types: [published]

jobs:
publish:
name: Publish CocoaPods
runs-on: macOS-latest
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Setup CocoaPods
uses: maxim-lobanov/setup-cocoapods@v1
with:
version: latest

- name: Publish CocoaPod
run: |
pod trunk push KeyValueObservation.podspec
2 changes: 1 addition & 1 deletion .github/workflows/upload-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- name: Build
run: |
./scripts/xcframework.sh -output ${TMPDIR}/KeyValueObservation.xcframework
./scripts/xcframework.sh --output ${TMPDIR}/KeyValueObservation.xcframework
- name: Create Zip
run: |
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/xcframework.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
name: XCFramework
on: [push, workflow_dispatch]
on:
workflow_dispatch:
push:
branches:
- '**'
tags-ignore:
- '**'
paths-ignore:
- .gitignore
- LICENSE
- README.md

jobs:
build:
Expand All @@ -14,4 +24,11 @@ jobs:

- name: Build
run: |
./scripts/xcframework.sh -output ${TMPDIR}/KeyValueObservation.xcframework
./scripts/xcframework.sh --build-dir "$TMPDIR"
- name: Upload Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: BuildLogs
path: ${{ env.TMPDIR }}/Logs/*.log
126 changes: 112 additions & 14 deletions .github/workflows/xcodebuild.yml
Original file line number Diff line number Diff line change
@@ -1,102 +1,200 @@
name: Xcode Project
on: [push, workflow_dispatch]
on:
workflow_dispatch:
push:
branches:
- '**'
tags-ignore:
- '**'
paths-ignore:
- .gitignore
- LICENSE
- README.md

jobs:
ios:
name: iOS
runs-on: macOS-latest
env:
LOGSDIR: /tmp/.keyvalueobservation.xcodebuild/iOS/Logs

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build iOS
run: |
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=iOS" -configuration Debug
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=iOS" -configuration Debug 2>&1 | tee "$LOGSDIR/build-ios.log"
- name: Build iOS Simulator
run: |
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=iOS Simulator" -configuration Debug
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=iOS Simulator" -configuration Debug 2>&1 | tee "$LOGSDIR/build-iossimulator.log"
- name: Test
run: |
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -testPlan "KeyValueObservationTests" -destination "platform=iOS Simulator,name=iPhone 12 Pro Max" -configuration Debug ONLY_ACTIVE_ARCH=YES test
IOS_SIM="$(xcrun simctl list devices available | grep "iPhone [0-9]" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
if [ "${#IOS_SIM}" == "0" ]; then
IOS_SIM = "iPhone 12 Pro" # Fallback Simulator
fi
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"
- name: Upload Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: iOSBuildLogs
path: ${{ env.LOGSDIR }}/*.log

maccatalyst:
name: Mac Catalyst
runs-on: macOS-latest
env:
LOGSDIR: /tmp/.keyvalueobservation.xcodebuild/macCatalyst/Logs

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build
run: |
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Debug
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Debug 2>&1 | tee "$LOGSDIR/build-maccatalyst.log"
- name: Test
run: |
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation" -testPlan "KeyValueObservationTests" -destination "platform=macOS,variant=Mac Catalyst" -configuration Debug ONLY_ACTIVE_ARCH=YES test
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"
- name: Upload Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: MacCatalystBuildLogs
path: ${{ env.LOGSDIR }}/*.log

macos:
name: macOS
runs-on: macOS-latest
env:
LOGSDIR: /tmp/.keyvalueobservation.xcodebuild/macOS/Logs

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build
run: |
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation macOS" -destination "generic/platform=macOS" -configuration Debug
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation macOS" -destination "generic/platform=macOS" -configuration Debug 2>&1 | tee "$LOGSDIR/build-macos.log"
- name: Test
run: |
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation macOS" -testPlan "KeyValueObservation macOS Tests" -configuration Debug -enableCodeCoverage YES test
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"
- name: Generate Code Coverage File
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
run: |
PROFDATA_FILE="$(find .xcodebuild -name "*.profdata")"
xcrun llvm-cov export --format=lcov --instr-profile="$PROFDATA_FILE" ".xcodebuild/Build/Products/Debug/KeyValueObservationTests.xctest/Contents/MacOS/KeyValueObservationTests" > "./codecov.lcov"
- name: Upload Code Coverage
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./codecov.lcov
verbose: true

- name: Upload Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: macOSBuildLogs
path: ${{ env.LOGSDIR }}/*.log

tvos:
name: tvOS
runs-on: macOS-latest
env:
LOGSDIR: /tmp/.keyvalueobservation.xcodebuild/tvOS/Logs

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build tvOS
run: |
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation tvOS" -destination "generic/platform=tvOS" -configuration Debug
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation tvOS" -destination "generic/platform=tvOS" -configuration Debug 2>&1 | tee "$LOGSDIR/build-tvos.log"
- name: Build tvOS Simulator
run: |
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation tvOS" -destination "generic/platform=tvOS Simulator" -configuration Debug
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation tvOS" -destination "generic/platform=tvOS Simulator" -configuration Debug 2>&1 | tee "$LOGSDIR/build-tvossimulator.log"
- name: Test
run: |
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
TVOS_SIM="$(xcrun simctl list devices available | grep "Apple TV" | sort -V | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
if [ "${#TVOS_SIM}" == "0" ]; then
TVOS_SIM = "Apple TV" # Fallback Simulator
fi
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"
- name: Upload Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: tvOSBuildLogs
path: ${{ env.LOGSDIR }}/*.log

watchos:
name: watchOS
runs-on: macOS-11
env:
LOGSDIR: /tmp/.keyvalueobservation.xcodebuild/watchOS/Logs

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Setup Environment
run: |
mkdir -p "$LOGSDIR"
- name: Build watchOS
run: |
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation watchOS" -destination "generic/platform=watchOS" -configuration Debug
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation watchOS" -destination "generic/platform=watchOS" -configuration Debug 2>&1 | tee "$LOGSDIR/build-watchos.log"
- name: Build watchOS Simulator
run: |
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation watchOS" -destination "generic/platform=watchOS Simulator" -configuration Debug
xcodebuild -project KeyValueObservation.xcodeproj -scheme "KeyValueObservation watchOS" -destination "generic/platform=watchOS Simulator" -configuration Debug 2>&1 | tee "$LOGSDIR/build-watchossimulator.log"
- name: Test
run: |
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
WATCHOS_SIM="$(xcrun simctl list devices available | grep "Apple Watch" | sort -rV | head -n 1 | sed -E 's/(.+)[ ]*\([^)]*\)[ ]*\([^)]*\)/\1/' | awk '{$1=$1};1')"
if [ "${#WATCHOS_SIM}" == "0" ]; then
WATCHOS_SIM = "Apple Watch Series 6 - 44mm" # Fallback Simulator
fi
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"
- name: Upload Logs
uses: actions/upload-artifact@v2
if: always()
with:
name: watchOSBuildLogs
path: ${{ env.LOGSDIR }}/*.log
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
KeyValueObservation.xcodeproj/project.xcworkspace
KeyValueObservation.xcodeproj/xcuserdata

.xcodebuild
scripts/build
6 changes: 0 additions & 6 deletions KeyValueObservation.modulemap

This file was deleted.

Loading

0 comments on commit 0a450d8

Please sign in to comment.