lint corrections, doc corrections, workflow improvements and num-trai… #407
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: Rust | |
on: | |
push: | |
pull_request: | |
branches: [ main, develop ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
profile: [test, release] | |
exclude: | |
- os: windows-latest | |
profile: release | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
default: true | |
- name: Run tests with serd | |
run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --features="serde-serialize" | |
- name: Run examples tests with serd | |
run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --features="serde-serialize" --examples | |
# it is faster to keep the going and reuse previous compilation artefact than using | |
# a matrix strategy and starting all over again | |
- name: Run tests no features | |
run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --no-default-features --features="overflow-test" | |
- name: Run examples tests no features | |
run: cargo +stable test --profile ${{ matrix.profile }} --all --verbose --no-fail-fast --no-default-features --features="overflow-test" --examples | |
linter: | |
name: lint code on nightly release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust nightly toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
components: clippy | |
default: true | |
- name: Linter | |
run: cargo +nightly clippy --all --verbose --tests --all-features -- --no-deps --deny warnings | |
- name: Linter release | |
run: cargo +nightly clippy --all --verbose --tests --release --all-features -- --no-deps --deny warnings |