Clean-up dependencies, do some chores #183
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 - Continuous Integration | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
name: Build | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown, thumbv7em-none-eabi | |
- name: Set up Cargo cache | |
uses: actions/cache@v4 | |
continue-on-error: false | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
~/target/ | |
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo-test- | |
- name: Checkout Submodules | |
run: git submodule update --init --recursive | |
- name: Build | |
run: cargo build | |
- name: Build (All Features) | |
run: cargo build --all-features | |
- name: Build (no_std) | |
run: cargo build --no-default-features --target thumbv7em-none-eabi | |
- name: Build (Wasm) | |
run: cargo build --no-default-features --target wasm32-unknown-unknown | |
test: | |
name: Test | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Set up Cargo cache | |
uses: actions/cache@v4 | |
continue-on-error: false | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
~/target/ | |
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo-test- | |
- name: Checkout Submodules | |
run: git submodule update --init --recursive | |
- name: Test (Release) | |
env: | |
RUSTFLAGS: "-C debug-assertions" | |
run: cargo test --release | |
test-memory: | |
name: Test Memory Consumption | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Test (Memory Consumption) | |
run: cargo test --release --features test-allocations -- --test-threads 1 test_memory_consumption | |
fmt: | |
name: Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
doc: | |
name: Documentation | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rust-docs, rust-src | |
- name: Check Docs | |
env: | |
RUSTDOCFLAGS: '-D warnings' | |
run: cargo doc --workspace --no-deps --document-private-items | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: clippy | |
- name: Check Clippy | |
run: cargo clippy -- -D warnings | |
outdated: | |
name: Outdated | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Check Dependencies | |
run: cargo outdated --root-deps-only --workspace --exit-code 1 | |
audit: | |
name: Audit | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Audit Dependencies | |
run: cargo audit --deny warnings | |
miri: | |
name: Miri | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: miri | |
- name: Test with Miri | |
run: cargo miri test | |
coverage: | |
name: Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Run cargo-tarpaulin | |
uses: actions-rs/[email protected] | |
with: | |
version: "0.18.0" | |
args: --features test-allocations --locked -- --test-threads 1 | |
- name: Upload to codecov.io | |
uses: codecov/[email protected] | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report | |
path: cobertura.xml |