v0.3.1 #586
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: rust | |
| concurrency: | |
| cancel-in-progress: false | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| on: | |
| pull_request: | |
| branches: [main, master] | |
| types: [synchronize] | |
| paths: | |
| - ".github/workflows/rust.yml" | |
| - "Cargo.toml" | |
| - "Cargo.lock" | |
| - "**/*.rs" | |
| push: | |
| branches: [main, master] | |
| tags: [latest, v*.*.*, "*-nightly"] | |
| repository_dispatch: | |
| types: [rust, rust-ci] | |
| workflow_dispatch: | |
| inputs: | |
| toolchain: | |
| description: 'Toolchain to test (stable or nightly)' | |
| required: false | |
| default: 'stable' | |
| type: choice | |
| options: [stable, nightly] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: full | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [x86_64-unknown-linux-gnu] | |
| toolchain: [stable] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| target: ${{ matrix.target }} | |
| toolchain: ${{ matrix.toolchain }} | |
| override: true | |
| - name: Build the workspace | |
| run: cargo build -r --locked --workspace --features full --target ${{ matrix.target }} | |
| test: | |
| if: github.event_name != 'workflow_dispatch' || github.event.inputs.toolchain == 'nightly' | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| features: [full, default] | |
| target: [x86_64-unknown-linux-gnu] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| target: ${{ matrix.target }} | |
| toolchain: stable | |
| override: true | |
| - name: Test (all-features) | |
| if: matrix.features == 'all' | |
| run: cargo test -r --locked --workspace --target ${{ matrix.target}} --all-features | |
| - name: Test (default) | |
| if: matrix.features == 'default' | |
| run: cargo test -r --locked --workspace --target ${{ matrix.target}} | |
| - name: Test (${{ matrix.features }}) | |
| if: matrix.features != 'default' | |
| run: cargo test -r --locked --workspace --target ${{ matrix.target}} --features ${{ matrix.features }} | |
| test_nightly: | |
| if: github.event.inputs.toolchain == 'nightly' || false | |
| continue-on-error: true | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| features: | |
| - all | |
| - no_std | |
| - "alloc,nightly" | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| toolchain: nightly | |
| override: true | |
| - name: Test (all-features) | |
| if: matrix.features == 'all' | |
| run: cargo test -r --locked --workspace --all-features | |
| - name: Test (no_std) | |
| continue-on-error: true | |
| if: matrix.features == 'no_std' | |
| run: cargo test -r --locked --workspace --no-default-features --features nightly | |
| env: | |
| RUSTFLAGS: "-C panic=abort -Z panic_abort_tests" | |
| - name: Test (${{ matrix.features }}) | |
| continue-on-error: true | |
| if: matrix.features != 'all' && matrix.features != 'no_std' | |
| run: cargo test -r --locked --workspace --no-default-features --features ${{ matrix.features }} | |
| env: | |
| RUSTFLAGS: "-C panic=abort -Z panic_abort_tests" |