Fix tarpaulin ci workflow #78
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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
format: | |
name: Format | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust stable | |
run: rustup toolchain install stable | |
- name: Check format | |
run: cargo fmt -- --check | |
no-std: | |
name: No std | |
runs-on: ubuntu-latest | |
env: | |
NO_STD_TARGET: thumbv7m-none-eabi | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust stable | |
run: rustup toolchain install stable | |
- name: Add no_std target | |
run: rustup target add ${{ env.NO_STD_TARGET }} | |
- name: Install cargo-hack | |
uses: taiki-e/install-action@cargo-hack | |
- name: Build with no_std compatible features | |
run: > | |
cargo hack build | |
--target ${{ env.NO_STD_TARGET }} | |
--no-dev-deps | |
--feature-powerset | |
--skip yield,thread_local | |
msrv: | |
name: MSRV | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust 1.65.0 | |
run: rustup toolchain install 1.65.0 | |
- name: Set Rust 1.65.0 as default | |
run: rustup default 1.65.0 | |
- name: Check MSRV | |
run: cargo check --all-features | |
docs: | |
name: Docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust nightly | |
run: rustup toolchain install nightly | |
- name: Set Rust nightly as default | |
run: rustup default nightly | |
- name: Build docs | |
env: | |
RUSTDOCFLAGS: --cfg docsrs -D warnings | |
run: cargo doc --all-features | |
examples: | |
name: Examples | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust stable | |
run: rustup toolchain install stable | |
- name: Run raw example | |
run: cargo run --example raw | |
- name: Run barging example | |
run: cargo run --example barging --features barging | |
- name: Run thread_local example | |
run: cargo run --example thread_local --features thread_local | |
- name: Run lock_api example | |
run: cargo run --example lock_api --features lock_api,barging | |
linter: | |
name: Linter | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust stable | |
run: rustup toolchain install stable | |
- name: Install cargo-hack | |
uses: taiki-e/install-action@cargo-hack | |
- name: Lint feature powerset | |
env: | |
RUSTFLAGS: -D warnings -D clippy::pedantic -D clippy::nursery | |
run: cargo hack clippy --feature-powerset --no-dev-deps | |
- name: Lint loom | |
env: | |
RUSTFLAGS: --cfg loom -D warnings -D clippy::pedantic -D clippy::nursery | |
run: cargo hack clippy --profile test --feature-powerset | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-latest | |
container: | |
# TODO: tarpaulin is currently failing to parse reports with llvm engine | |
# for Rust >= 1.77 because of the llvm 18 update. Version 0.27.3 pulls | |
# Rust 1.76.0. | |
image: xd009642/tarpaulin:0.27.3 | |
options: --security-opt seccomp=unconfined | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Generate coverage | |
run: > | |
cargo tarpaulin | |
--verbose | |
--engine llvm | |
--all-features | |
--out xml | |
- name: Upload to Codecov | |
uses: codecov/codecov-action@v3 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
miri: | |
name: Miri | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust nightly and Miri | |
# NOTE: not all nightly releases come with Miri | |
run: rustup toolchain install nightly --component miri | |
- name: Set Rust nightly as default | |
run: rustup default nightly | |
- name: Miri test | |
run: cargo miri test --all-features | |
loom: | |
name: Loom | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Rust stable | |
run: rustup toolchain install stable | |
- name: Loom test | |
env: | |
RUSTFLAGS: --cfg loom | |
run: cargo test --lib --release --all-features |