add a GitHub Actions workflow to run tests on PRs #7
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: Pull request | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| tests: | |
| name: Test | |
| uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@0.0.12 | |
| with: | |
| enable_macos_checks: true | |
| linux_swift_versions: '["nightly-main", "6.0"]' | |
| windows_swift_versions: '["nightly-main"]' | |
| # Note that 'swift test' will fail on this repository as there are no test targets. | |
| macos_build_command: 'xcrun swift run api_test' | |
| linux_build_command: 'swift run api_test' | |
| windows_build_command: 'Invoke-Program swift run api_test' | |
| make-tests: | |
| name: Make tests | |
| uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@0.0.12 | |
| with: | |
| enable_macos_checks: true | |
| linux_swift_versions: '["nightly-main"]' | |
| windows_swift_versions: '["nightly-main"]' | |
| macos_pre_build_command: './.github/scripts/prebuild.sh' | |
| macos_build_command: 'export PATH=$PATH:$RUNNER_TOOL_CACHE && make test' | |
| linux_pre_build_command: './.github/scripts/prebuild.sh' | |
| linux_build_command: 'make test' | |
| windows_pre_build_command: 'Invoke-Program .\.github\scripts\prebuild.ps1' | |
| windows_build_command: 'Invoke-Program make test' |