dirkengine 0.1.0

A pure Rust Vulkan game engine
Documentation
name: Format and Clippy

on:
  push:
    branches:
      - main
    paths-ignore:
      - 'nix/**'
      - 'flake.nix'
      - 'flake.lock'
      - 'README.md'
  pull_request:
    paths-ignore:
      - 'nix/**'
      - 'flake.nix'
      - 'flake.lock'
      - 'README.md'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always

permissions:
  contents: read

jobs:
  clippy:
    name: Clippy (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest] #, windows-latest, macos-latest]
    steps:
      - uses: actions/checkout@v6
      - name: Install Rust toolchain with Clippy
        uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
        with:
          shared-key: "ci-${{ matrix.os }}"
      # -D warnings promotes all Clippy warnings to errors, failing the job
      - name: cargo clippy (default features)
        run: cargo clippy --workspace --locked -- -D warnings
      - name: cargo clippy (no default features)
        run: cargo clippy --workspace --locked --no-default-features -- -D warnings
      - name: cargo clippy (all features)
        run: cargo clippy --workspace --locked --all-features -- -D warnings

  fmt:
    name: Formatting
    # Formatting is machine-independent, so we only need to run on one OS
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Install stable Rust toolchain with rustfmt
        uses: dtolnay/rust-toolchain@stable
      # --check exits with a non-zero code if any files would be reformatted,
      # failing the job without modifying any files
      - name: cargo fmt --check
        run: cargo fmt --all --check