Skip to content

Refactor test macros to builder pattern #975

Refactor test macros to builder pattern

Refactor test macros to builder pattern #975

Workflow file for this run

name: CI
on:
merge_group:
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
rust-test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Check formatting of all crates in the workspace
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run cargo test --all
uses: actions-rs/cargo@v1
with:
command: test
args: --all
- name: Run cargo test --all-targets
uses: actions-rs/cargo@v1
with:
command: test
args: --all-targets
conclusion:
needs:
- rust-test
permissions:
contents: none
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
# when the workflow is canceled manually.
#
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: Conclusion
run: |
# Print the dependent jobs to see them in the CI log
jq -C <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful.
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'