contracts 0.6.7

Design-by-contract attributes
Documentation
name: Coverage

on:
  push:
    branches: [main]

permissions:
  contents: read

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  coverage:
    runs-on: ubuntu-latest
    name: Coverage
    steps:
      - uses: actions/checkout@v5

      - name: Install Determinate Nix
        uses: DeterminateSystems/determinate-nix-action@v3
        with:
          extra-conf: lazy-trees = true

      - name: Set up FlakeHub Cache
        uses: DeterminateSystems/flakehub-cache-action@v2

      - name: Install Rust
        uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
        with:
          components: llvm-tools-preview

      - name: Enter Nix devshell
        uses: nicknovitski/nix-develop@v1.2.1

      - name: Install cargo-llvm-cov
        uses: taiki-e/install-action@v2.62.1
        with:
          tool: cargo-llvm-cov

      - name: Generate code coverage
        run: just test-coverage-codecov

      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v5.5.1
        with:
          files: codecov.json
          fail_ci_if_error: true
        env:
          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}