mrrc 0.7.6

A Rust library for reading, writing, and manipulating MARC bibliographic records in ISO 2709 binary format
Documentation
name: Code Coverage

on:
  workflow_dispatch:

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1

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

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable

      - name: Cache cargo
        uses: actions/cache@v5
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-coverage-${{ hashFiles('**/Cargo.lock') }}

      - name: Install tarpaulin
        uses: taiki-e/install-action@cargo-tarpaulin

      - name: Generate coverage reports
        run: |
          # Exclude mrrc-python (PyO3 bindings) as it requires Python linking
          # Focus coverage on the core mrrc library
          cargo tarpaulin --out Xml Html --package mrrc --timeout 300 --exclude-files examples/ --exclude-files tests/

      - name: Upload coverage to codecov.io
        uses: codecov/codecov-action@v6
        with:
          files: ./cobertura.xml
          flags: unit-tests
          fail_ci_if_error: false
          verbose: true
          token: ${{ secrets.CODECOV_TOKEN }}

      - name: Upload coverage artifacts
        uses: actions/upload-artifact@v7
        if: always()
        with:
          name: coverage-report
          path: tarpaulin-report.html