Migrate to latest libafl 0.14.1 #18
Workflow file for this run
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 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 | |
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/ | |
thorough-docs-check: | |
name: Thorough Documentation Check | |
runs-on: ubuntu-latest | |
# This allows the job to fail without failing the whole workflow | |
continue-on-error: true | |
steps: | |
# Check out the repository | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Install the Rust toolchain | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: clippy # Ensure Clippy is installed | |
# Run the thorough documentation check | |
- name: Run thorough documentation check | |
run: | | |
# Use Clippy to check for missing documentation | |
# -D missing_docs: Elevate missing docs on public items to an error | |
# -W clippy::missing_docs_in_private_items: Warn about missing docs in private items | |
cargo clippy --workspace --all-features -- -D missing_docs -W clippy::missing_docs_in_private_items | |
# Provide a summary of the results | |
- name: Summarize results | |
if: always() # This step will run even if the previous step fails | |
run: | | |
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." |