Merge pull request #18 from SomeRandomiOSDev/strict-concurrency #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Xcode Project | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
paths-ignore: | |
- '.github/**' # Ignore all files under '.github' | |
- '!.github/workflows/xcodebuild.yml' # Except for this workflow | |
- '.gitignore' | |
- '.remarkrc' | |
- '.swiftlint.yml' | |
- 'codecov.yml' | |
- 'Documentation/**' | |
- 'LICENSE' | |
- 'Package.swift' | |
- 'README.md' | |
- 'Tests/**' | |
- 'Half.podspec' | |
jobs: | |
ios: | |
strategy: | |
matrix: | |
os: [macOS-13] | |
xcode: ['15.0'] | |
name: iOS | |
runs-on: ${{ matrix.os }} | |
env: | |
LOGSDIR: /tmp/.half.xcodebuild/iOS/Logs | |
steps: | |
- name: Select Xcode Version | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: ${{ matrix.xcode }} | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Environment | |
run: | | |
mkdir -p "$LOGSDIR" | |
- name: Build iOS | |
run: | | |
xcodebuild -project "Half.xcodeproj" -scheme "Half" -destination "generic/platform=iOS" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-ios.log" | |
- name: Build iOS Simulator | |
run: | | |
xcodebuild -project "Half.xcodeproj" -scheme "Half" -destination "generic/platform=iOS Simulator" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-iossimulator.log" | |
- name: Test | |
run: | | |
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 "Half.xcodeproj" -scheme "Half" -testPlan "HalfTests" -destination "platform=iOS Simulator,name=$IOS_SIM" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-ios.log" | |
- name: Upload Logs | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: iOSBuildLogs | |
path: ${{ env.LOGSDIR }}/*.log | |
maccatalyst: | |
strategy: | |
matrix: | |
os: [macOS-13] | |
xcode: ['15.0'] | |
name: Mac Catalyst | |
runs-on: ${{ matrix.os }} | |
env: | |
LOGSDIR: /tmp/.half.xcodebuild/macCatalyst/Logs | |
steps: | |
- name: Select Xcode Version | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: ${{ matrix.xcode }} | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Environment | |
run: | | |
mkdir -p "$LOGSDIR" | |
- name: Build | |
run: | | |
xcodebuild -project "Half.xcodeproj" -scheme "Half" -destination "generic/platform=macOS,variant=Mac Catalyst" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-maccatalyst.log" | |
- name: Test | |
run: | | |
xcodebuild -project "Half.xcodeproj" -scheme "Half" -testPlan "HalfTests" -destination "platform=macOS,variant=Mac Catalyst" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-maccatalyst.log" | |
- name: Upload Logs | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: MacCatalystBuildLogs | |
path: ${{ env.LOGSDIR }}/*.log | |
macos: | |
strategy: | |
matrix: | |
os: [macOS-13] | |
xcode: ['15.0'] | |
name: macOS | |
runs-on: ${{ matrix.os }} | |
env: | |
LOGSDIR: /tmp/.half.xcodebuild/macOS/Logs | |
steps: | |
- name: Select Xcode Version | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: ${{ matrix.xcode }} | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Environment | |
run: | | |
mkdir -p "$LOGSDIR" | |
- name: Build | |
run: | | |
xcodebuild -project "Half.xcodeproj" -scheme "Half macOS" -destination "generic/platform=macOS" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-macos.log" | |
- name: Test | |
run: | | |
xcodebuild -project "Half.xcodeproj" -scheme "Half macOS" -testPlan "Half macOS Tests" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-macos.log" | |
- name: Upload Logs | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: macOSBuildLogs | |
path: ${{ env.LOGSDIR }}/*.log | |
tvos: | |
strategy: | |
matrix: | |
os: [macOS-13] | |
xcode: ['15.0'] | |
name: tvOS | |
runs-on: ${{ matrix.os }} | |
env: | |
LOGSDIR: /tmp/.half.xcodebuild/tvOS/Logs | |
steps: | |
- name: Select Xcode Version | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: ${{ matrix.xcode }} | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Environment | |
run: | | |
mkdir -p "$LOGSDIR" | |
- name: Build tvOS | |
run: | | |
xcodebuild -project "Half.xcodeproj" -scheme "Half tvOS" -destination "generic/platform=tvOS" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-tvos.log" | |
- name: Build tvOS Simulator | |
run: | | |
xcodebuild -project "Half.xcodeproj" -scheme "Half tvOS" -destination "generic/platform=tvOS Simulator" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-tvossimulator.log" | |
- name: Test | |
run: | | |
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 "Half.xcodeproj" -scheme "Half tvOS" -testPlan "Half tvOS Tests" -destination "platform=tvOS Simulator,name=$TVOS_SIM" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-tvos.log" | |
- name: Upload Logs | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: tvOSBuildLogs | |
path: ${{ env.LOGSDIR }}/*.log | |
watchos: | |
strategy: | |
matrix: | |
os: [macOS-13] | |
xcode: ['15.0'] | |
name: watchOS | |
runs-on: ${{ matrix.os }} | |
env: | |
LOGSDIR: /tmp/.half.xcodebuild/watchOS/Logs | |
steps: | |
- name: Select Xcode Version | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: ${{ matrix.xcode }} | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Setup Environment | |
run: | | |
mkdir -p "$LOGSDIR" | |
- name: Build watchOS | |
run: | | |
xcodebuild -project "Half.xcodeproj" -scheme "Half watchOS" -destination "generic/platform=watchOS" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-watchos.log" | |
- name: Build watchOS Simulator | |
run: | | |
xcodebuild -project "Half.xcodeproj" -scheme "Half watchOS" -destination "generic/platform=watchOS Simulator" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES 2>&1 | tee "$LOGSDIR/build-watchossimulator.log" | |
- name: Test | |
run: | | |
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 "Half.xcodeproj" -scheme "Half watchOS" -testPlan "Half watchOS Tests" -destination "platform=watchOS Simulator,name=$WATCHOS_SIM" -configuration Debug RUN_DOCUMENTATION_COMPILER=NO SKIP_SWIFTLINT=YES ONLY_ACTIVE_ARCH=YES test 2>&1 | tee "$LOGSDIR/test-watchos.log" | |
- name: Upload Logs | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: watchOSBuildLogs | |
path: ${{ env.LOGSDIR }}/*.log |