diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..0476efd --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,34 @@ +name: Coverage + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + + +jobs: + coverage: + runs-on: ubuntu-latest # Works on Windows/macOS too, adjust if needed + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Ensures Git history is available for Coveralls + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + components: llvm-tools-preview # Needed for cargo-llvm-cov + + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + + - name: Generate coverage data + run: | + cargo llvm-cov --lcov --output-path lcov.info + + - name: Coveralls GitHub Action + uses: coverallsapp/github-action@v2.3.6 diff --git a/README.md b/README.md index 5eb99b0..eb741e0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # picojson [![Build and test](https://github.com/kaidokert/picojson-rs/actions/workflows/build.yaml/badge.svg)](https://github.com/kaidokert/picojson-rs/actions/workflows/build.yaml) +[![Coverage Status](https://coveralls.io/repos/github/kaidokert/picojson-rs/badge.svg?branch=main)](https://coveralls.io/github/kaidokert/picojson-rs?branch=main) A minimal Rust JSON **pull-parser** for resource-constrained environments.