From 9e03a8bf45c43640bb5e759c76fae92425f6ff4d Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Fri, 26 Jul 2024 17:15:34 +0200 Subject: [PATCH] set up code coverage --- .github/workflows/rust.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 25c5214..12b025e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -30,3 +30,33 @@ jobs: run: cargo build --verbose - name: Run tests run: cargo test --verbose + + coverage: + name: Coverage + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Install rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + - name: Cache + uses: Swatinem/rust-cache@v1 + - name: Install cargo-tarpaulin + uses: actions-rs/cargo@v1 + with: + command: install + args: cargo-tarpaulin + - name: Run cargo tarpaulin + uses: actions-rs/cargo@v1 + with: + command: tarpaulin + args: --output-dir coverage --out xml --workspace --tests --example log --example rfc5424 --example write + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: Geal/rust-syslog \ No newline at end of file