CI #55
Workflow file for this run
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: merge_group | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: [ | |
1.60.0, # MSRV | |
1.62.0, # has_total_cmp | |
stable, | |
beta, | |
nightly, | |
] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
if: startsWith(matrix.rust, '1') | |
with: | |
path: ~/.cargo/registry/index | |
key: cargo-${{ matrix.rust }}-git-index | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- run: cargo build | |
env: | |
# https://github.com/rust-lang/cargo/issues/10303 | |
CARGO_NET_GIT_FETCH_WITH_CLI: true | |
- run: ./ci/test_full.sh | |
# i586 presents floating point challenges for lack of SSE/SSE2 | |
i586: | |
name: Test (i586) | |
runs-on: ubuntu-latest | |
steps: | |
- run: | | |
sudo apt-get update | |
sudo apt-get install gcc-multilib | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
target: i586-unknown-linux-gnu | |
- run: cargo test --target i586-unknown-linux-gnu --all-features | |
# try a target that doesn't have std at all | |
no_std: | |
name: No Std | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
target: thumbv6m-none-eabi | |
- run: cargo build --target thumbv6m-none-eabi --no-default-features | |
- run: cargo build --target thumbv6m-none-eabi --no-default-features --features libm | |
fmt: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/[email protected] | |
with: | |
components: rustfmt | |
- run: cargo fmt --all --check | |
# One job that "summarizes" the success state of this pipeline. This can then be added to branch | |
# protection, rather than having to add each job separately. | |
success: | |
name: Success | |
runs-on: ubuntu-latest | |
needs: [test, i586, no_std, fmt] | |
# Github branch protection is exceedingly silly and treats "jobs skipped because a dependency | |
# failed" as success. So we have to do some contortions to ensure the job fails if any of its | |
# dependencies fails. | |
if: always() # make sure this is never "skipped" | |
steps: | |
# Manually check the status of all dependencies. `if: failure()` does not work. | |
- name: check if any dependency failed | |
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' |