Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 109 additions & 6 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ on:
- main

jobs:
build-test:
build-test-13:
name: Build & Test
runs-on: macos-12
runs-on: macos-13
strategy:
matrix:
include:
- sim: "iOS 17"
xcode: "15.0"
- sim: "iOS 16"
xcode: "14.2"
- sim: "iOS 15"
xcode: "13.4.1"
xcode: "14.3.1"
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -39,9 +39,112 @@ jobs:
id: find-sim-destination
run: |
case "${{ matrix.sim }}" in
"iOS 17")
echo SIM_DESTINATION="OS=17.0,name=iPhone 14 Pro" >> $GITHUB_OUTPUT
;;
"iOS 16")
echo SIM_DESTINATION="OS=16.2,name=iPhone 14 Pro" >> $GITHUB_OUTPUT
echo SIM_DESTINATION="OS=16.4,name=iPhone 14 Pro" >> $GITHUB_OUTPUT
;;
*)
echo "Unknown OS: ${{ matrix.sim }}"
exit 1
;;
esac

- name: Build & Test Package for iOS
run: |
set -o pipefail && \
env NSUnbufferedIO=YES \
xcodebuild \
-workspace . \
-scheme "OnLaunch-iOS-Client" \
-sdk iphonesimulator \
-destination "${{ steps.find-sim-destination.outputs.SIM_DESTINATION }}" \
-enableCodeCoverage YES \
-derivedDataPath DerivedData \
CODE_SIGNING_ALLOWED="NO" \
build test 2>&1 | tee test-output.log | xcbeautify

- name: Build Example for UIKit
run: |
set -o pipefail && \
env NSUnbufferedIO=YES \
xcodebuild \
-project Examples/Examples.xcodeproj \
-scheme "Example-UIKit" \
-sdk iphonesimulator \
-destination "${{ steps.find-sim-destination.outputs.SIM_DESTINATION }}" \
-derivedDataPath DerivedData \
CODE_SIGNING_ALLOWED="NO" \
build 2>&1 | tee test-output.log | xcbeautify

- name: Build Example for SwiftUI
run: |
set -o pipefail && \
env NSUnbufferedIO=YES \
xcodebuild \
-project Examples/Examples.xcodeproj \
-scheme "Example-SwiftUI" \
-sdk iphonesimulator \
-destination "${{ steps.find-sim-destination.outputs.SIM_DESTINATION }}" \
-derivedDataPath DerivedData \
CODE_SIGNING_ALLOWED="NO" \
build 2>&1 | tee test-output.log | xcbeautify

- name: Upload test log file on error
uses: actions/upload-artifact@v3
if: failure()
with:
name: Test Output ${{ matrix.sim }}.log
path: test-output.log

- name: Generate code coverage reports
run: |
mkdir -p coverage
PROFDATA_PATH=$(pwd)/$(find DerivedData -name "*.profdata")
echo "Detected profdata at path: $PROFDATA_PATH"
xcrun llvm-cov export \
$(pwd)/DerivedData/Build/Products/Debug-iphonesimulator/OnLaunchTests.xctest/OnLaunchTests \
--instr-profile $PROFDATA_PATH \
--format="lcov" > coverage/coverage.lcov

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage.lcov
name: codecov-umbrella
flags: unittests
fail_ci_if_error: true

build-test-12:
name: Build & Test
runs-on: macos-12
strategy:
matrix:
include:
- sim: "iOS 15"
xcode: "13.4.1"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Set the fetch-depth > 1 or set to 0 for codecov upload detection
fetch-depth: 2

- name: Enable development dependencies
run: sed -i.bak "s/\/\/dev//g" Package.swift

- name: Install Homebrew dependencies
run: brew install xcbeautify

- name: Select Xcode
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app

- name: Find Simulator Destination
id: find-sim-destination
run: |
case "${{ matrix.sim }}" in
"iOS 15")
echo SIM_DESTINATION="OS=15.5,name=iPhone 13 Pro" >> $GITHUB_OUTPUT
;;
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
deploy_docs:
name: Deploy Documentation
runs-on: macos-12
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down