Skip to content

More flexibility on numerical/string doc id and quantization #107

More flexibility on numerical/string doc id and quantization

More flexibility on numerical/string doc id and quantization #107

Workflow file for this run

name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
RUST_LOG: info
RUST_BACKTRACE: 1
jobs:
build:
name: Test on ${{ matrix.os }} and ${{ matrix.rust }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
rust: [stable, beta, nightly]
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
- uses: actions/checkout@v2
- run: cargo test --verbose --workspace
cargo-check:
name: Check for warnings
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
- run: cargo check --workspace --all-targets --verbose
clippy:
name: Lint with Clippy
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
- uses: hecrj/setup-rust-action@v2
with:
components: clippy
- run: cargo clippy --workspace --all-targets --verbose
rustfmt:
name: Verify code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
components: rustfmt
- run: cargo fmt --all -- --check
check-rustdoc-links:
name: Check intra-doc links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: nightly
- run: cargo rustdoc --lib -- -D warnings
- run: cargo rustdoc --bin pisa2ciff -- -D warnings
- run: cargo rustdoc --bin ciff2pisa -- -D warnings
code-coverage:
name: Run code coverage
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Zinstrument-coverage
LLVM_PROFILE_FILE: coverage-%p-%m.profraw
steps:
- uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: llvm-tools-preview
- name: Install grcov
uses: taiki-e/install-action@v2
with:
tool: grcov@0.8.18
- name: Build and test
run: cargo test --verbose --workspace
- name: Generate coverage report
run: |
mkdir coverage
grcov . \
--binary-path ./target/debug/ \
--source-dir . \
--output-type lcov \
--branch \
--ignore-not-existing \
--ignore "/*" \
--ignore "target/*" \
--ignore "tests/*" \
--ignore "src/bin/*" \
--output-path coverage/lcov.info
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage/lcov.info
miri:
name: Miri test
runs-on: ubuntu-latest
env:
RUST_LOG: quickcheck
steps:
- uses: actions/checkout@v2
- run: |
MIRI_NIGHTLY=$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)
echo "Installing latest nightly with Miri: $MIRI_NIGHTLY"
rustup set profile minimal
rustup toolchain install "nightly-$MIRI_NIGHTLY"
rustup default "nightly-$MIRI_NIGHTLY"
rustup component add miri
cargo miri test --lib