CI #376
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: CI | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
schedule: | |
- cron: 30 1 * * * | |
jobs: | |
test: | |
runs-on: macos-12 | |
env: | |
PROJECT: URLRouter.xcodeproj | |
SCHEME: URLRouter-Package | |
CODECOV_PACKAGE_NAME: URLRouter | |
strategy: | |
matrix: | |
env: | |
- sdk: iphonesimulator | |
destination: platform=iOS Simulator,name=iPhone 14 Pro,OS=16.2 | |
- sdk: macosx | |
destination: platform=macOS,arch=x86_64 | |
- sdk: appletvsimulator | |
destination: platform=tvOS Simulator,name=Apple TV,OS=16.0 | |
- sdk: applewatchsimulator | |
destination: platform=watchOS Simulator,OS=9.0,name=Apple Watch Series 5 (44mm) | |
steps: | |
- uses: actions/checkout@v3 | |
- name: List SDKs and Devices | |
run: xcodebuild -showsdks && xcrun xctrace list devices | |
- name: Generate Xcode Project | |
run: swift package generate-xcodeproj | |
- name: Build and Test | |
run: | | |
xcodebuild clean build test \ | |
-project "$PROJECT" \ | |
-scheme "$SCHEME" \ | |
-destination "$DESTINATION" \ | |
-configuration Debug \ | |
-enableCodeCoverage YES | |
env: | |
SDK: ${{ matrix.env.sdk }} | |
DESTINATION: ${{ matrix.env.destination }} | |
- name: Upload Code Coverage | |
run: | | |
bash <(curl -s https://codecov.io/bash) \ | |
-X xcodeplist \ | |
-J "$CODECOV_PACKAGE_NAME" | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |