diff --git a/.github/workflows/audit.yaml b/.github/workflows/audit.yaml new file mode 100644 index 0000000..b7d2efb --- /dev/null +++ b/.github/workflows/audit.yaml @@ -0,0 +1,27 @@ +name: Audit + +on: ["push", "pull_request"] + +env: + CARGO_TERM_COLOR: always + RUST_TOOLCHAIN: 1.86.0 + +jobs: + audit: + name: Audit + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + + - name: Install cargo-audit + run: cargo install cargo-audit + + - name: Run security audit + run: cargo audit diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 93117d5..c64967a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,6 +1,6 @@ name: Build -on: [push] +on: ["push", "pull_request"] permissions: contents: write diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 0000000..438d9a2 --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,53 @@ +name: Coverage + +on: ["push", "pull_request"] + +env: + CARGO_TERM_COLOR: always + RUST_TOOLCHAIN: 1.86.0 + +jobs: + coverage: + name: Code Coverage + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + + - name: Cache vcpkg + uses: actions/cache@v4 + with: + path: target/vcpkg + key: A-vcpkg-${{ runner.os }}-${{ hashFiles('Cargo.toml', 'Cargo.lock') }} + restore-keys: | + A-vcpkg-${{ runner.os }}- + + - name: Vcpkg Linux Dependencies + run: | + sudo apt-get update + sudo apt-get install -y libltdl-dev + + - name: Vcpkg + run: | + cargo install cargo-vcpkg + cargo vcpkg -v build + + - name: Install cargo-tarpaulin + run: cargo install cargo-tarpaulin + + - name: Generate coverage report + run: cargo tarpaulin --out Html --output-dir coverage + + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + files: ./coverage/tarpaulin-report.html + allow-empty: false diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..aa2fc03 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,51 @@ +name: Test + +on: ["push", "pull_request"] + +env: + CARGO_TERM_COLOR: always + RUST_TOOLCHAIN: 1.86.0 + +jobs: + test: + name: Test + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + + - name: Cache vcpkg + uses: actions/cache@v4 + with: + path: target/vcpkg + key: A-vcpkg-${{ runner.os }}-${{ hashFiles('Cargo.toml', 'Cargo.lock') }} + restore-keys: | + A-vcpkg-${{ runner.os }}- + + - name: Vcpkg Linux Dependencies + run: | + sudo apt-get update + sudo apt-get install -y libltdl-dev + + - name: Vcpkg + run: | + cargo install cargo-vcpkg + cargo vcpkg -v build + + - name: Run tests + run: cargo test --workspace --verbose + + - name: Run clippy + run: cargo clippy -- -D warnings + + - name: Check formatting + run: cargo fmt -- --check