drm-gfx 0.2.1

3D graphics rendering for direct rendering manager with optional tokio thread support
Documentation
on: [push, pull_request]

name: rust
permissions:
  actions: read # Read workflow data
  contents: read # Read repository contents

jobs:
  check:
    name: Check
    runs-on: ubuntu-latest
    permissions:
      contents: read
      checks: write
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
      - run: echo "::add-matcher::.github/rust.json"
      - run: cargo check --example triangles --example points --example lines
      - run: cargo check --features tokio-threads --example tokio-triangles
      - run: echo "::remove-matcher owner=rust"

  lints:
    name: Lints
    runs-on: ubuntu-latest
    permissions:
      contents: read
      checks: write
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
      - run: echo "::add-matcher::.github/rust.json"
      - run: cargo clippy --all-features -- -D warnings
      - run: cargo fmt --all --check

  doc:
    needs:
      - lints
      - check
    name: cargo doc
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
      - run: cargo doc

  test:
    needs:
      - lints
      - check
    name: cargo test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
      - run: cargo build --example triangles --example lines --example points --example spinning-cube
      - run: cargo build --features tokio-threads --example tokio-triangles
      - run: cargo test --tests --lib

  build:
    needs:
      - test
    name: cargo build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: dtolnay/rust-toolchain@stable
      - run: cargo build --lib
      - run: cargo build --lib --features tokio-threads
      - run: cargo build --example triangles --example lines --example points --example spinning-cube
      - run: cargo build --features tokio-threads --example tokio-triangles
      - run: cargo build --release --lib
      - run: cargo build --release --example triangles --example lines --example points --example spinning-cube
      - run: cargo build --release --features tokio-threads --example tokio-triangles