pasetors 0.8.0

PASETO: Platform-Agnostic Security Tokens (in Rust)
Documentation
on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - "*"    

name: Code coverage
permissions:
  contents: read

# We don't need to run older workflows for the same PR's, since we always want the output of the newest ones.
concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  check:
    name: Code coverage
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          persist-credentials: false
      
      - name: Install toolchain
        run: rustup toolchain install stable && rustup component add llvm-tools

      - name: Install grcov
        run: cargo install grcov
      
      - name: Generate code coverage
        env:
          CARGO_INCREMENTAL: "0"
          RUSTFLAGS: "-Cinstrument-coverage"
          LLVM_PROFILE_FILE: "cargo-test-%p-%m.profraw"
        run: cargo test --all-features
      
      - name: Create coverage file
        run: |
          grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o ./target/coverage.lcov

      - name: Upload to codecov.io
        uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
        with:
          fail_ci_if_error: true
          files: ./target/*.lcov