diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc958c2..2d28c02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,9 +61,24 @@ jobs: cargo set-version ${{ needs.setup_release.outputs.release_version }} - name: Test + id: test uses: ./ci/github-actions/arch-run with: - command: cargo test + command: cargo install cargo-tarpaulin; cargo tarpaulin --engine llvm --out Xml + + - name: Upload coverage + # any except canceled or skipped + if: >- + always() && + (steps.test.outcome == 'success' || steps.test.outcome == 'failure') && + startsWith(github.repository, 'LizardByte/') + uses: codecov/codecov-action@v4 + with: + disable_search: true + fail_ci_if_error: true + files: cobertura.xml + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true - name: Clippy uses: ./ci/github-actions/arch-run diff --git a/README.md b/README.md index 49afc0d..e8df329 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![GitHub stars](https://img.shields.io/github/stars/lizardbyte/pacman-repo-builder.svg?logo=github&style=for-the-badge)](https://github.com/LizardByte/pacman-repo-builder) [![GitHub Releases](https://img.shields.io/github/downloads/lizardbyte/pacman-repo-builder/total.svg?style=for-the-badge&logo=github)](https://github.com/LizardByte/pacman-repo-builder/releases/latest) [![GitHub Workflow Status (CI)](https://img.shields.io/github/actions/workflow/status/lizardbyte/pacman-repo-builder/ci.yml.svg?branch=master&label=CI%20build&logo=github&style=for-the-badge)](https://github.com/LizardByte/pacman-repo-builder/actions/workflows/ci.yml?query=branch%3Amaster) +[![Codecov](https://img.shields.io/codecov/c/gh/LizardByte/pacman-repo-builder?token=HZPhTVKYKt&style=for-the-badge&logo=codecov&label=codecov)](https://codecov.io/gh/LizardByte/pacman-repo-builder) Build a custom pacman repository from a collection of PKGBUILD directories. diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..e9c9c87 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,19 @@ +--- +codecov: + branch: master + +coverage: + status: + project: + default: + target: auto + threshold: 10% + +comment: + layout: "diff, flags, files" + behavior: default + require_changes: false # if true: only post the comment if coverage changes + +ignore: + - "tests" + - "third-party"