build #815
This file contains hidden or 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 | |
| permissions: | |
| contents: read | |
| 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: swift-textfile | |
| WORKSPACEPATH: .swiftpm/xcode/package.xcworkspace | |
| jobs: | |
| macOS: | |
| name: Tests (macOS) | |
| runs-on: macos-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Build | |
| run: xcodebuild build -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "generic/platform=macOS" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| - name: Unit Tests | |
| run: xcodebuild test -skipMacroValidation -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "platform=macOS" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| macOS-swift6-2: | |
| name: Tests (macOS - Swift 6.2) | |
| runs-on: macos-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Set Package to Swift 6.2 | |
| run: swift package tools-version --set "6.2" | |
| - name: Build | |
| run: xcodebuild build -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "generic/platform=macOS" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| - name: Unit Tests | |
| run: xcodebuild test -skipMacroValidation -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "platform=macOS" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| macCatalyst: | |
| name: Tests (macCatalyst) | |
| runs-on: macos-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Build | |
| run: xcodebuild build -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "generic/platform=macOS,variant=Mac Catalyst" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| - name: Unit Tests | |
| run: xcodebuild test -skipMacroValidation -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "platform=macOS,variant=Mac Catalyst" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| device-simulators: | |
| name: Tests | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| target: [iOS, tvOS, watchOS, visionOS] | |
| continue-on-error: true | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@main | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: latest-stable | |
| - name: Prepare Device Simulator | |
| id: sim-setup | |
| uses: orchetect/setup-xcode-simulator@v1 | |
| with: | |
| refresh: true | |
| download: true | |
| scheme: ${{ env.SCHEME }} | |
| target: ${{ matrix.target }} | |
| - name: Build | |
| run: xcodebuild build -skipMacroValidation -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "generic/platform=$PLATFORMSHORT" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| env: | |
| PLATFORMSHORT: ${{ steps.sim-setup.outputs.platform-short }} | |
| WORKSPACEPATH: ${{ steps.sim-setup.outputs.workspace-path }} | |
| - name: Unit Tests | |
| run: xcodebuild test -skipMacroValidation -workspace "$WORKSPACEPATH" -scheme "$SCHEME" -destination "platform=$PLATFORM,id=$ID" | xcbeautify --renderer github-actions && exit ${PIPESTATUS[0]} | |
| env: | |
| ID: ${{ steps.sim-setup.outputs.id }} | |
| PLATFORM: ${{ steps.sim-setup.outputs.platform }} | |
| WORKSPACEPATH: ${{ steps.sim-setup.outputs.workspace-path }} | |
| linux: | |
| name: Tests (Linux) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@main | |
| - name: Build | |
| run: swift build | |
| - name: Unit Tests | |
| run: swift test |