Updated GitHub CI #523
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: build | |
on: | |
push: | |
branches: [main, dev] | |
paths-ignore: | |
- 'Docs/**' # Docs folder in root of repo | |
- '**/*.md' # .md files anywhere in the repo | |
- '**/LICENSE' # LICENSE files anywhere in the repo | |
- '**/.gitignore' # .gitignore files anywhere in the repo | |
pull_request: | |
branches: [main] | |
paths-ignore: | |
- 'Docs/**' # Docs folder in root of repo | |
- '**/*.md' # .md files anywhere in the repo | |
- '**/LICENSE' # LICENSE files anywhere in the repo | |
- '**/.gitignore' # .gitignore files anywhere in the repo | |
workflow_dispatch: | |
# schedule: | |
# - cron: '40 11 * * *' # once a day @ 11:40am UTC (4:40am PST) | |
env: | |
SCHEME: "OSCKit-CI" | |
jobs: | |
macOS: | |
name: macOS | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@main | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Build | |
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "generic/platform=macOS,name=Any Mac" | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Unit Tests | |
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "platform=macOS" | xcpretty && exit ${PIPESTATUS[0]} | |
macOS-swift6: | |
name: macOS (Swift 6.0) | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@main | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: 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" | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Unit Tests | |
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "platform=macOS" | xcpretty && exit ${PIPESTATUS[0]} | |
macCatalyst: | |
name: macCatalyst | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@main | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Build | |
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "generic/platform=macOS,variant=Mac Catalyst,name=Any Mac" | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Unit Tests | |
run: xcodebuild test -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "platform=macOS,variant=Mac Catalyst" | xcpretty && exit ${PIPESTATUS[0]} | |
iOS: | |
name: iOS | |
runs-on: macos-15 | |
steps: | |
- uses: actions/checkout@main | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Build | |
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "generic/platform=iOS Simulator,name=Any iOS Device" | xcpretty && 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" | xcpretty && exit ${PIPESTATUS[0]} | |
tvOS: | |
name: tvOS | |
runs-on: macos-15 | |
steps: | |
- uses: actions/checkout@main | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Build | |
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "generic/platform=tvOS Simulator,name=Any tvOS Simulator Device" | xcpretty && 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/tvOS\sSimulator.*(Apple\sTV\s4K.*)\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=tvOS Simulator,name=$DESTNAME" | xcpretty && exit ${PIPESTATUS[0]} | |
watchOS: | |
name: watchOS | |
runs-on: macos-15 | |
steps: | |
- uses: actions/checkout@main | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Build | |
run: xcodebuild build -workspace ".swiftpm/xcode/package.xcworkspace" -scheme "$SCHEME" -destination "generic/platform=watchOS Simulator,name=Any watchOS Simulator Device" | xcpretty && 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/watchOS\sSimulator.*(Apple\sWatch\sSeries\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=watchOS Simulator,name=$DESTNAME" | xcpretty && exit ${PIPESTATUS[0]} | |
examples: | |
name: Examples | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@main | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: latest-stable | |
- name: Basic Example - Resolve Package Dependencies # needed because sometimes xcodebuild fails otherwise | |
run: xcodebuild -project "Examples/Basic Example/Basic Example.xcodeproj" -resolvePackageDependencies | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Basic Example - Build | |
run: xcodebuild build -project "Examples/Basic Example/Basic Example.xcodeproj" -scheme "Basic Example" -destination "generic/platform=macOS,name=Any Mac" | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Custom Type Example - Resolve Package Dependencies # needed because sometimes xcodebuild fails otherwise | |
run: xcodebuild -project "Examples/Custom Type Example/Custom Type Example.xcodeproj" -resolvePackageDependencies | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Custom Type Example - Build | |
run: xcodebuild build -project "Examples/Custom Type Example/Custom Type Example.xcodeproj" -scheme "Custom Type Example" -destination "generic/platform=macOS,name=Any Mac" | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Method Blocks Example - Resolve Package Dependencies # needed because sometimes xcodebuild fails otherwise | |
run: xcodebuild -project "Examples/Method Blocks Example/Method Blocks Example.xcodeproj" -resolvePackageDependencies | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Method Blocks Example - Build | |
run: xcodebuild build -project "Examples/Method Blocks Example/Method Blocks Example.xcodeproj" -scheme "Method Blocks Example" -destination "generic/platform=macOS,name=Any Mac" | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Method IDs Example - Resolve Package Dependencies # needed because sometimes xcodebuild fails otherwise | |
run: xcodebuild -project "Examples/Method IDs Example/Method IDs Example.xcodeproj" -resolvePackageDependencies | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Method IDs Example - Build | |
run: xcodebuild build -project "Examples/Method IDs Example/Method IDs Example.xcodeproj" -scheme "Method IDs Example" -destination "generic/platform=macOS,name=Any Mac" | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Socket Example - Resolve Package Dependencies # needed because sometimes xcodebuild fails otherwise | |
run: xcodebuild -project "Examples/Socket Example/Socket Example.xcodeproj" -resolvePackageDependencies | xcpretty && exit ${PIPESTATUS[0]} | |
- name: Socket Example - Build | |
run: xcodebuild build -project "Examples/Socket Example/Socket Example.xcodeproj" -scheme "Socket Example" -destination "generic/platform=macOS,name=Any Mac" | xcpretty && exit ${PIPESTATUS[0]} |