vcard-rs 0.2.0

vCard parser, validator, editor and builder library for Rust
Documentation
name: Tests

on:
  push:
  pull_request:

jobs:
  check:
    name: fmt + clippy + test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - uses: Swatinem/rust-cache@v2
      - run: cargo fmt --all --check
      - run: cargo clippy --all-targets --all-features -- -D warnings
      - run: cargo test --all-features

  coverage:
    name: coverage -> codecov
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: llvm-tools-preview
      - uses: Swatinem/rust-cache@v2
      - uses: taiki-e/install-action@cargo-tarpaulin
      - name: Measure coverage (cobertura.xml)
        run: cargo tarpaulin --all-features --engine llvm --out Xml
      - name: Upload to Codecov
        uses: codecov/codecov-action@v4
        with:
          files: cobertura.xml
          token: ${{ secrets.CODECOV_TOKEN }}
          fail_ci_if_error: false

  fuzz-regression:
    name: fuzz corpus replay
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@nightly
      - uses: Swatinem/rust-cache@v2
      - name: Install cargo-fuzz
        run: cargo install cargo-fuzz --locked
      - name: Loosen ASan shadow-memory ASLR for the libFuzzer runner
        run: sudo sysctl -w vm.mmap_rnd_bits=28
      - name: Replay the committed corpus through the fuzz target
        run: |
          mkdir -p fuzz/corpus/parse
          find tests/corpus -name '*.vcf' | while read -r f; do
            cp "$f" "fuzz/corpus/parse/${f//\//_}"
          done
          cargo fuzz run parse fuzz/corpus/parse -- -runs=0