Skip to content

Mike/ci workflow

Mike/ci workflow #12

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
xcodebuild:
runs-on: macos-latest
strategy:
fail-fast: true
matrix:
platform: [iOS, macOS, tvOS, watchOS, visionOS]
swift-version: [5.9, 5.10, 6.0]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select -s /Applications/Xcode_15.0.app
- name: Setup Swift
uses: fwal/setup-swift@v1
with:
swift-version: ${{ matrix.swift-version }}
- name: Cache Derived Data
uses: actions/cache@v3
with:
path: ~/.derivedData
key: deriveddata-${{ matrix.platform }}-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift') }}
restore-keys: |
deriveddata-${{ matrix.platform }}-
- name: Set IgnoreFileSystemDeviceInodeChanges flag
run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
- name: Build and Test
run: |
set -eo pipefail
case "${{ matrix.platform }}" in
iOS)
destination="platform=iOS Simulator,name=iPhone 15 Pro,OS=17.0"
;;
macOS)
destination="platform=macOS,arch=x86_64"
;;
tvOS)
destination="platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=17.0"
;;
watchOS)
destination="platform=watchOS Simulator,name=Apple Watch Series 9 (41mm),OS=10.0"
;;
visionOS)
destination="platform=visionOS,name=Vision Pro,OS=1.0"
;;
esac
xcodebuild clean build test \
-scheme Clerk \
-configuration Debug \
-destination "$destination" \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty
- name: Upload Test Results (Optional)
if: always()
uses: actions/upload-artifact@v3
with:
name: TestResults-${{ matrix.platform }}-${{ matrix.swift-version }}
path: build/reports