Merge torrust/bencode2json#13: Include <string> tags for valid UTF-…
#3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Coverage | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| coverage: | |
| name: Generate and Upload Coverage Report | |
| environment: coverage | |
| runs-on: ubuntu-latest | |
| env: | |
| CARGO_INCREMENTAL: "0" | |
| RUSTFLAGS: "-Cinstrument-coverage" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install LLVM tools | |
| run: sudo apt-get update && sudo apt-get install -y llvm | |
| - id: setup | |
| name: Setup Toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| toolchain: nightly | |
| components: llvm-tools-preview | |
| - id: cache | |
| name: Enable Workflow Cache | |
| uses: Swatinem/rust-cache@v2 | |
| - id: tools | |
| name: Install Tools | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: grcov,cargo-llvm-cov | |
| - id: coverage | |
| name: Generate Coverage Report | |
| run: | | |
| cargo test | |
| cargo llvm-cov --lcov --output-path=./lcov.info | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| verbose: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ${{ github.workspace }}/lcov.info | |
| fail_ci_if_error: true |