Eliminate recursion #141
Workflow file for this run
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: test-rust | |
| on: | |
| pull_request: | |
| branches: [ "*" ] | |
| workflow_call: | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| resolve-msrv: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| MSRV: ${{ steps.resolve-msrv.outputs.MSRV }} | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| with: | |
| python-version: '3.14' | |
| enable-cache: false | |
| - name: resolve MSRV | |
| id: resolve-msrv | |
| run: | | |
| echo MSRV=`python -c 'import tomllib; print(tomllib.load(open("Cargo.toml", "rb"))["package"]["rust-version"])'` >> $GITHUB_OUTPUT | |
| check-msrv: | |
| needs: [resolve-msrv] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - run: echo MSRV=${NEEDS_RESOLVE_MSRV_OUTPUTS_MSRV} | |
| env: | |
| NEEDS_RESOLVE_MSRV_OUTPUTS_MSRV: ${{ needs.resolve-msrv.outputs.MSRV }} | |
| - run: rustup default ${NEEDS_RESOLVE_MSRV_OUTPUTS_MSRV} && rustup default ${NEEDS_RESOLVE_MSRV_OUTPUTS_MSRV} | |
| env: | |
| NEEDS_RESOLVE_MSRV_OUTPUTS_MSRV: ${{ needs.resolve-msrv.outputs.MSRV }} | |
| # this check is very slow, so, set up a cache | |
| - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 | |
| - run: cargo build --verbose | |
| - run: cargo test --verbose | |
| test_rust: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Format | |
| run: cargo fmt --check | |
| - name: Lint | |
| run: cargo clippy | |
| - name: Check semver | |
| uses: obi1kenobi/cargo-semver-checks-action@v2 | |
| - name: Run tests | |
| run: cargo test | |
| - name: Run tests with FMA | |
| run: cargo test --features=fma | |
| - name: Test no-std | |
| run: | | |
| rustup target add thumbv7em-none-eabihf | |
| cargo build --target thumbv7em-none-eabihf --no-default-features | |
| - name: Publish dry-run | |
| if: github.ref != 'refs/heads/main' | |
| run: cargo publish --dry-run |