Skip to content

chore(deps): bump the all-dependencies group across 1 directory with 13 updates #34

chore(deps): bump the all-dependencies group across 1 directory with 13 updates

chore(deps): bump the all-dependencies group across 1 directory with 13 updates #34

Workflow file for this run

name: Rust CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
build-and-test:
name: Build, Test, and Coverage
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, nightly]
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# Install Rust toolchain
- name: Install Rust ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy
# Cache dependencies to speed up builds
- name: Cache Cargo registry and build artifacts
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# Run `cargo fmt` to check formatting
- name: Check formatting with rustfmt
run: cargo fmt --all -- --check
# Run `cargo clippy` for linting
- name: Run Clippy for linting
run: cargo clippy --all-targets --all-features -- -D warnings
# Build the entire workspace
- name: Build the workspace
run: cargo build --workspace --verbose
# Run tests for all crates in the workspace
- name: Run tests for all crates in the workspace
run: cargo test --workspace --verbose
# Run the thorough documentation check and summarize results
- name: Run thorough documentation check and summarize results
run: |
# Run Clippy and capture the exit code
cargo clippy --workspace --all-features -- -D missing_docs -W clippy::missing_docs_in_private_items
CLIPPY_EXIT_CODE=$?
# Summarize the results
echo "Thorough documentation check completed."
echo "This job is allowed to fail without breaking the workflow."
echo "Please review the output above for any missing documentation warnings or errors."
echo "Gradually address these issues to improve your project's documentation coverage."
# Exit with the captured Clippy exit code
exit $CLIPPY_EXIT_CODE
# Check for uncommitted changes
- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Uncommitted changes found after build!"
git status
exit 1
else
echo "No uncommitted changes found."
fi
coverage:
name: Code Coverage (Tarpaulin)
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# Install Rust nightly toolchain with required components for Tarpaulin or llvm-tools-preview
- name: Install nightly toolchain with llvm-tools-preview
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: llvm-tools-preview
# Install Tarpaulin for coverage generation (requires nightly)
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
# Generate code coverage reports for all crates in the workspace using Tarpaulin
- name: Generate code coverage report with Tarpaulin
run: |
cargo tarpaulin --workspace --out Html --output-dir ./coverage-report \
--ignore-tests --all-features
# Upload the generated coverage report as an artifact to GitHub Actions for inspection or download.
- name: Upload code coverage report as artifact
uses: actions/upload-artifact@v4
with:
name: code-coverage-report-html
path: ./coverage-report/