fixed clippy, more build issues #17
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, develop ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| test: | |
| name: Test Suite | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| rust: [stable, beta] | |
| exclude: | |
| # Reduce CI load by only testing beta on Ubuntu | |
| - os: windows-latest | |
| rust: beta | |
| - os: macos-latest | |
| rust: beta | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| components: rustfmt, clippy | |
| - name: Setup Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: ${{ matrix.os }}-${{ matrix.rust }} | |
| - name: Install ClamAV (Ubuntu) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clamav clamav-daemon | |
| sudo systemctl stop clamav-freshclam | |
| sudo systemctl stop clamav-daemon | |
| # Create test socket directory | |
| sudo mkdir -p /var/run/clamav | |
| sudo chown clamav:clamav /var/run/clamav | |
| - name: Install ClamAV (macOS) | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| brew install clamav | |
| # Create test socket directory | |
| sudo mkdir -p /opt/homebrew/var/run/clamav | |
| - name: Install ClamAV (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| # ClamAV for Windows - download and install | |
| choco install clamav | |
| shell: powershell | |
| - name: Check formatting | |
| if: matrix.rust == 'stable' | |
| run: cargo fmt --all -- --check | |
| - name: Run clippy | |
| if: matrix.rust == 'stable' | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Build | |
| run: cargo build --verbose --all-features | |
| - name: Run tests | |
| run: cargo test --verbose --all-features | |
| - name: Run doc tests | |
| run: cargo test --doc | |
| security: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Setup Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit | |
| - name: Run security audit | |
| run: cargo audit | |
| - name: Install cargo-deny | |
| run: cargo install cargo-deny --locked | |
| - name: Run cargo-deny check | |
| run: cargo deny check | |
| coverage: | |
| name: Code Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Setup Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install ClamAV | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clamav clamav-daemon | |
| sudo systemctl stop clamav-freshclam | |
| sudo systemctl stop clamav-daemon | |
| sudo mkdir -p /var/run/clamav | |
| sudo chown clamav:clamav /var/run/clamav | |
| - name: Install tarpaulin | |
| run: cargo install cargo-tarpaulin | |
| - name: Run coverage | |
| run: cargo tarpaulin --verbose --all-features --workspace --timeout 120 --out xml | |
| - name: Upload to codecov.io | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: cobertura.xml | |
| fail_ci_if_error: true |