universal ci #1307
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: Universal CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: | |
- '*' | |
schedule: | |
# run at 10:30AM & 10:30PM UTC | |
- cron: '30 10,22 * * *' | |
jobs: | |
linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Test (Debug) | |
run: swift test -v --configuration debug | |
- name: Test (Release) | |
run: swift test -v --configuration release -Xswiftc -enable-testing | |
darwin: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Test watchOS (Debug) | |
run: xcodebuild test -configuration Debug -scheme "universal-Package" -destination "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm)" | |
- name: Test watchOS (Release) | |
run: xcodebuild test -configuration Release -scheme "universal-Package" -destination "platform=watchOS Simulator,name=Apple Watch Series 8 (45mm)" | |
- name: Test tvOS (Debug) | |
run: xcodebuild test -configuration Debug -scheme "universal-Package" -sdk "appletvsimulator" -destination "platform=tvOS Simulator,name=Apple TV" | |
- name: Test tvOS (Release) | |
run: xcodebuild test -configuration Release -scheme "universal-Package" -sdk "appletvsimulator" -destination "platform=tvOS Simulator,name=Apple TV" | |
- name: Test iOS (Debug) | |
run: xcodebuild test -configuration Debug -scheme "universal-Package" -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 14" | |
- name: Test iOS (Release) | |
run: xcodebuild test -configuration Release -scheme "universal-Package" -sdk "iphonesimulator" -destination "platform=iOS Simulator,name=iPhone 14" | |
- name: Test macOS (Debug) | |
run: swift test -v --configuration debug | |
- name: Test macOS (Release) | |
run: swift test -v --configuration release -Xswiftc -enable-testing | |
api-doc: | |
if: false | |
runs-on: macos-latest | |
timeout-minutes: 20 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build documentation | |
run: | | |
swift -version | |
export SWIFTPM_ENABLE_COMMAND_PLUGINS=1 | |
export DOCC_JSON_PRETTYPRINT="YES" | |
# insert the docc dependency manually using sed to avoid | |
# polluting Package.swift with unnecessary dependencies | |
sed -I "" 's;^ *var dependencies: \[Package.Dependency] = \[$; var dependencies: [Package.Dependency] = [ .package(name: "swift-docc-plugin", url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"), ;1' Package.swift | |
cat Package.swift | |
swift package --allow-writing-to-directory docs \ | |
generate-documentation --target Universal \ | |
--disable-indexing \ | |
--transform-for-static-hosting \ | |
--hosting-base-path Universal \ | |
--output-path docs | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: '.' | |