chore: align workspace version to 0.2.7 to match existing git tag #66
This file contains hidden or 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, develop ] | |
pull_request: | |
branches: [ main ] | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: 1 | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo check --all-features | |
test: | |
name: Test Suite | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
rust: [stable] | |
include: | |
- os: ubuntu-latest | |
rust: stable | |
coverage: true | |
- os: ubuntu-latest | |
rust: beta | |
- os: ubuntu-latest | |
rust: nightly | |
experimental: true | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.experimental || false }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.os }}-${{ matrix.rust }} | |
- name: Run unit tests | |
run: cargo test --all-features --workspace | |
- name: Run doctests | |
run: cargo test --doc --all-features --workspace | |
integration-tests: | |
name: Integration Tests | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run integration tests | |
run: cargo test --test '*' --all-features --workspace | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo clippy --all-features --all-targets --workspace | |
coverage: | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install tarpaulin | |
run: cargo install cargo-tarpaulin | |
- name: Generate coverage | |
run: | | |
# Run with memory limits to prevent allocation issues | |
cargo tarpaulin \ | |
--out Xml \ | |
--all-features \ | |
--workspace \ | |
--timeout 600 \ | |
--exclude-files "target/*" \ | |
--exclude-files "*/tests/*" \ | |
--exclude-files "*/benches/*" \ | |
--ignore-panics \ | |
--skip-clean \ | |
|| echo "Coverage generation failed but continuing" | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./cobertura.xml | |
flags: unittests | |
name: codecov-prism | |
fail_ci_if_error: false # Don't fail CI if coverage upload fails | |
benchmarks: | |
name: Performance Benchmarks | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install benchmark dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y valgrind | |
- name: Run benchmarks | |
run: | | |
# Create benchmark baseline if it doesn't exist | |
if [ ! -f benchmark_baseline.json ]; then | |
echo "Creating initial benchmark baseline" | |
cargo bench --workspace --bench '*' -- --output-format json > benchmark_baseline.json || true | |
fi | |
# Run current benchmarks | |
cargo bench --workspace --bench '*' -- --output-format json > benchmark_current.json || true | |
- name: Compare benchmarks | |
run: | | |
if [ -f benchmark_baseline.json ] && [ -f benchmark_current.json ]; then | |
echo "## 📊 Performance Benchmark Results" >> $GITHUB_STEP_SUMMARY | |
echo "Benchmarks completed. Results available for analysis." >> $GITHUB_STEP_SUMMARY | |
else | |
echo "Benchmark comparison skipped - baseline or current results missing" >> $GITHUB_STEP_SUMMARY | |
fi | |
security: | |
name: Security Audit | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: rustsec/audit-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
# Allow warnings about unmaintained crates, but fail on vulnerabilities | |
ignore: RUSTSEC-2025-0012,RUSTSEC-2024-0384,RUSTSEC-2024-0436 | |
dependency-check: | |
name: Dependency Analysis | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install cargo-deny | |
run: cargo install cargo-deny | |
- name: Check dependencies | |
run: | | |
cargo deny init || true # Create deny.toml if it doesn't exist | |
cargo deny check || echo "Dependency check completed with warnings" | |
msrv: | |
name: Minimum Supported Rust Version | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get MSRV from Cargo.toml | |
id: msrv | |
run: | | |
MSRV=$(grep -E "^rust-version" Cargo.toml | cut -d'"' -f2) | |
echo "msrv=$MSRV" >> $GITHUB_OUTPUT | |
echo "Testing MSRV: $MSRV" | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ steps.msrv.outputs.msrv }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Test with MSRV | |
run: cargo check --all-features --workspace | |
quality-gates: | |
name: Quality Gates | |
runs-on: ubuntu-latest | |
needs: [check, test, integration-tests, fmt, clippy, security, dependency-check] | |
if: always() | |
steps: | |
- name: Check all jobs status | |
run: | | |
echo "## 🎯 Quality Gates Summary" >> $GITHUB_STEP_SUMMARY | |
if [ "${{ needs.check.result }}" == "success" ]; then | |
echo "✅ **Compilation Check**: PASSED" >> $GITHUB_STEP_SUMMARY | |
else | |
echo "❌ **Compilation Check**: FAILED" >> $GITHUB_STEP_SUMMARY | |
fi | |
if [ "${{ needs.test.result }}" == "success" ]; then | |
echo "✅ **Unit Tests**: PASSED" >> $GITHUB_STEP_SUMMARY | |
else | |
echo "❌ **Unit Tests**: FAILED" >> $GITHUB_STEP_SUMMARY | |
fi | |
if [ "${{ needs.integration-tests.result }}" == "success" ]; then | |
echo "✅ **Integration Tests**: PASSED" >> $GITHUB_STEP_SUMMARY | |
else | |
echo "❌ **Integration Tests**: FAILED" >> $GITHUB_STEP_SUMMARY | |
fi | |
if [ "${{ needs.fmt.result }}" == "success" ]; then | |
echo "✅ **Code Formatting**: PASSED" >> $GITHUB_STEP_SUMMARY | |
else | |
echo "❌ **Code Formatting**: FAILED" >> $GITHUB_STEP_SUMMARY | |
fi | |
if [ "${{ needs.clippy.result }}" == "success" ]; then | |
echo "✅ **Clippy Linting**: PASSED" >> $GITHUB_STEP_SUMMARY | |
else | |
echo "❌ **Clippy Linting**: FAILED" >> $GITHUB_STEP_SUMMARY | |
fi | |
if [ "${{ needs.security.result }}" == "success" ]; then | |
echo "✅ **Security Audit**: PASSED" >> $GITHUB_STEP_SUMMARY | |
else | |
echo "❌ **Security Audit**: FAILED" >> $GITHUB_STEP_SUMMARY | |
fi | |
# Fail the job if any critical checks failed | |
if [ "${{ needs.check.result }}" != "success" ] || \ | |
[ "${{ needs.test.result }}" != "success" ] || \ | |
[ "${{ needs.fmt.result }}" != "success" ] || \ | |
[ "${{ needs.clippy.result }}" != "success" ]; then | |
echo "❌ **Quality Gates**: FAILED - Critical checks failed" | |
exit 1 | |
else | |
echo "✅ **Quality Gates**: PASSED - All critical checks successful" | |
fi |