Skip to content

Proposal: add more thorough coverage of the crate to CI #3

Proposal: add more thorough coverage of the crate to CI

Proposal: add more thorough coverage of the crate to CI #3

Workflow file for this run

name: Rust
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
# Abort a run of CI jobs if a newer run is triggered
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Check formatting
run: cargo fmt --check
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Check
run: cargo check --verbose
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Clippy
run: cargo clippy --verbose -- -D warnings
# Emulates building the documentation on docs.rs and fails if there are any errors or warnings.
doc:
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
RUSTDOCFLAGS: --cfg docsrs
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Generate documentation
run: cargo +nightly doc --no-deps
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --verbose
# Tests the crate on both stable and beta toolchains.
# This lets us catch potential issues on the beta toolchain before they are released.
test:
strategy:
matrix:
toolchain: [stable, beta]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Test
run: cargo test --verbose
# Verify that we have not broken semver in the API.
semver-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@v2
with:
tool: cargo-semver-checks
- name: Verify semver compatibility
run: cargo semver-checks
run_examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Run first example
run: cargo run --example bessel_fractional_test
- name: Run second example
run: cargo run --example bessel_integer_test
- name: Run third example
run: cargo run --example modified_bessel_fractional_test
- name: Run fourth example
run: cargo run --example modified_bessel_integer_test