Gate PRs on build success #659
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 & Test | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build-spm: | |
name: Build & Test (SPM) | |
runs-on: windows-2022 | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout repo | |
uses: actions/[email protected] | |
- name: Setup Visual Studio Development Environment | |
uses: compnerd/gha-setup-vsdevenv@f1ba60d553a3216ce1b89abe0201213536bc7557 # main as of 2024-11-12 | |
- name: Install Swift | |
uses: compnerd/gha-setup-swift@b6c5fc1ed5b5439ada8e7661985acb09ad8c3ba2 # main as of 2024-11-12 | |
with: | |
branch: swift-5.8-release | |
tag: 5.8-RELEASE | |
- name: Build | |
run: swift build --verbose --build-tests | |
- name: Test | |
run: swift test --verbose --skip-build | |
build-cmake: | |
name: Build (CMake) | |
runs-on: windows-2022 | |
timeout-minutes: 20 | |
steps: | |
- name: Checkout repo | |
uses: actions/[email protected] | |
- name: Setup Visual Studio Development Environment | |
uses: compnerd/gha-setup-vsdevenv@main | |
- name: Install Swift | |
uses: compnerd/gha-setup-swift@b6c5fc1ed5b5439ada8e7661985acb09ad8c3ba2 # main as of 2024-11-12 | |
with: | |
branch: swift-5.8-release | |
tag: 5.8-RELEASE | |
- name: CMake Configure | |
shell: pwsh | |
run: cmake -S . -B build -G Ninja | |
- name: CMake Build | |
shell: pwsh | |
run: cmake --build .\build | |
go-no-go: # Required status check | |
name: Go/No-Go | |
needs: [build-spm, build-cmake] | |
if: always() | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fail if any required job failed | |
if: contains(needs.*.result, 'failure') | |
run: exit 1 |