diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 52244952..efa2e69f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,14 +41,17 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@v2 with: - profile: minimal - toolchain: stable - override: true + tool: cargo-llvm-cov - - name: Run cargo test - uses: actions-rs/cargo@v1 + - name: Run tests + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 with: - command: test + token: ${{ secrets.CODECOV_TOKEN }} + files: lcov.info + fail_ci_if_error: true diff --git a/.gitignore b/.gitignore index a19bac44..ef4fcad1 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ bin/ # Test binary, built with `go test -c` *.test +lcov.info # Output of the go coverage tool, specifically when used with LiteIDE *.out diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..0c12deee --- /dev/null +++ b/codecov.yml @@ -0,0 +1,18 @@ +coverage: + precision: 2 + round: down + range: "80...100" + status: + project: + default: + enabled: no + patch: + default: + enabled: no + +comment: + layout: "reach, diff, flags, files" + behavior: default + require_changes: false + branches: + - main