Skip to content

build

build #167

Workflow file for this run

name: build
on:
push:
paths-ignore:
- '**/*.md' # .md files anywhere in the repo
- '**/LICENSE' # LICENSE files anywhere in the repo
- '**/.gitignore' # .gitignore files anywhere in the repo
- '**/*.png' # .png image files anywhere in the repo
- '**/*.pdf' # .pdf files anywhere in the repo
- '**/*.cursorrules' # .cursorrules files anywhere in the repo
pull_request:
paths-ignore:
- '**/*.md' # .md files anywhere in the repo
- '**/LICENSE' # LICENSE files anywhere in the repo
- '**/.gitignore' # .gitignore files anywhere in the repo
- '**/*.png' # .png image files anywhere in the repo
- '**/*.pdf' # .pdf files anywhere in the repo
- '**/*.cursorrules' # .cursorrules files anywhere in the repo
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Runs at 8 AM Singapore time (00:00 UTC) every day
env:
SCHEME: "XLKit-CI"
jobs:
macOS:
name: macOS
runs-on: macos-15 # required for Xcode 16.x
steps:
- uses: actions/checkout@main
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.4' # Use Xcode 16.4
- name: Build
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "generic/platform=macOS,name=Any Mac" | xcbeautify && exit ${PIPESTATUS[0]}
- name: Unit Tests
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "platform=macOS" | xcbeautify && exit ${PIPESTATUS[0]}
- name: Test Runner
run: swift run XLKitTestRunner help
- name: Test Image Embedding
run: swift run XLKitTestRunner embed
macOS-swift6:
name: macOS (Swift 6)
runs-on: macos-15 # required for Xcode 16.x
steps:
- uses: actions/checkout@main
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.4' # Use specific stable version instead of latest-stable
- name: Set Package to Swift 6.0
run: swift package tools-version --set "6.0"
- name: Build
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "generic/platform=macOS,name=Any Mac" | xcbeautify && exit ${PIPESTATUS[0]}
- name: Unit Tests
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "platform=macOS" | xcbeautify && exit ${PIPESTATUS[0]}
- name: Test Runner
run: swift run XLKitTestRunner help
- name: Test Image Embedding
run: swift run XLKitTestRunner embed
iOS:
name: iOS
runs-on: macos-15 # required for Xcode 16.x
steps:
- uses: actions/checkout@main
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.4' # Use specific stable version instead of latest-stable
- name: Install iOS Simulator Runtime
run: |
# List available runtimes
xcrun simctl runtime list -v
# Install iOS runtime if not present
xcodebuild -downloadPlatform iOS || true
- name: Build
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "generic/platform=iOS Simulator,name=Any iOS Device" | xcbeautify && exit ${PIPESTATUS[0]}
- name: Prepare Destination Device Name
shell: bash
run: |
DESTNAME=$(xcodebuild -showdestinations -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" | perl -nle 'if (m/iOS\sSimulator.*(iPhone\s[\d]{2}.*)\s\}\.*/g) { print $1; }' | sort -r | head -n 1)
echo Using device \"$DESTNAME\"
echo "DESTNAME=$DESTNAME" >> "$GITHUB_ENV"
- name: Unit Tests
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "platform=iOS Simulator,name=$DESTNAME" | xcbeautify && exit ${PIPESTATUS[0]}