openusd 0.3.0

Rust native USD library
Documentation
name: CI
on:
  pull_request:
  push:
  schedule:
    - cron: '0 0 * * 0' # Run weekly on Sundays

jobs:
  checks:
    name: Checks
    runs-on: ${{ matrix.os }}
    timeout-minutes: 15

    strategy:
      fail-fast: false
      matrix:
        os: [macos-latest, ubuntu-latest, windows-latest]

    steps:
      - uses: actions/checkout@v6
        with:
          submodules: true

      - run: cargo check --examples --tests
      - run: cargo clippy --all-targets --all-features -- -D warnings
      - run: cargo fmt --all -- --check --files-with-diff
      - run: cargo doc --no-deps
      - run: cargo test --all-targets --all-features

  deny:
    name: Deny
    runs-on: ubuntu-22.04
    timeout-minutes: 10

    steps:
      - uses: actions/checkout@v6
        with:
          submodules: true
      - uses: EmbarkStudios/cargo-deny-action@v2

  coverage:
    name: Coverage
    runs-on: ubuntu-latest
    timeout-minutes: 15
    if: ${{ github.event_name != 'schedule' && github.ref_name == 'main' }}

    steps:
      - uses: actions/checkout@v6
        with:
          submodules: true

      - run: cargo install grcov
      - run: grcov --version

      - run: cargo test --all-features
        env:
          RUSTFLAGS: "-Cinstrument-coverage"
          LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw"

      - name: Collect coverage data
        run: |
          grcov . \
            --source-dir . \
            --binary-path ./target/debug/ \
            --branch \
            --ignore-not-existing \
            --output-types markdown,lcov \
            --keep-only 'src/*' \
            --output-path ./target/coverage/

      - name: Upload coverage data
        uses: codecov/codecov-action@v6
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          flags: unittests
          files: ./target/coverage/lcov
          verbose: true

      - name: Publish job summary
        run: |
          echo "# Coverage" >> $GITHUB_STEP_SUMMARY
          cat target/coverage/markdown.md >> $GITHUB_STEP_SUMMARY