name: Coverage

on:
  push:
    branches: [main]

env:
  CARGO_TERM_COLOR: always

jobs:
  coverage:
    name: llvm-cov → coveralls
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: llvm-tools-preview
      - uses: taiki-e/install-action@v2
        with:
          tool: cargo-llvm-cov
      - uses: Swatinem/rust-cache@v2
      - run: cargo llvm-cov --lcov --output-path lcov.info
      - uses: coverallsapp/github-action@v2
        with:
          file: lcov.info
          format: lcov
