fontsan 0.6.1

Sanitiser for untrusted font files
Documentation
name: CI

on: [push, pull_request]

jobs:
  build_and_test:
    name: Build and Test
    strategy:
      matrix:
        os:
          - "ubuntu-latest"
          - "macos-latest"
          - "windows-latest"
        features:
          - ""
          - "libz-rs"
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - name: Build
        run: cargo build --features "${{ matrix.features }}" -vv
      - name: Test
        run: cargo test --features "${{ matrix.features }}" -vv
        env:
          RUST_BACKTRACE: 1
  fmt:
    name: Format check
    runs-on: "ubuntu-latest"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
      - name: Cargo fmt
        run: cargo fmt --check
  msrv:
    name: Check minimum supported Rust version
    runs-on: "ubuntu-latest"
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable 6 months ago
      - name: MSRV build
        run: cargo build -vv
      - name: MSRV test
        run: cargo test -vv
        env:
          RUST_BACKTRACE: 1

  build_result:
    name: Result
    runs-on: ubuntu-latest
    needs:
      - "build_and_test"
      - "fmt"
      - "msrv"
    steps:
      - name: Mark the job as successful
        if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
        run: exit 0
      - name: Mark the job as unsuccessful
        if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
        run: exit 1