lab-resource-manager 1.1.0

GPU and room resource management system with Google Calendar and Slack integration
Documentation
name: Code Quality

on:
  push:
    branches:
      - main
      - develop
  pull_request:
    types: [opened, synchronize, reopened]
    branches:
      - main
      - develop
  workflow_dispatch:
  workflow_call:

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  cargo-build:
    name: Cargo Build
    runs-on: ubuntu-latest

    steps:
      - name: Fetch Repository
        uses: actions/checkout@v5

      - name: Install stable toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1

      - name: cargo build
        run: cargo b --workspace --all-targets --all-features

  cargo-fmt:
    name: Cargo fmt
    runs-on: ubuntu-latest

    steps:
      - name: Fetch Repository
        uses: actions/checkout@v5

      - name: Install stable toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          components: rustfmt

      - name: Rustfmt Check
        run: cargo fmt --all --check

  cargo-clippy:
    name: Cargo clippy
    runs-on: ubuntu-latest

    steps:
      - name: Fetch Repository
        uses: actions/checkout@v5

      - name: Install stable toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          components: clippy

      - name: Clippy Check
        run: cargo clippy --workspace --all-targets --all-features -- -Dwarnings

  cargo-doc:
    name: Cargo doc
    runs-on: ubuntu-latest

    steps:
      - name: Fetch Repository
        uses: actions/checkout@v5

      - name: Install stable toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1

      - name: Cargo doc test
        run: cargo doc --workspace --all-features

  cargo-test-doc:
    name: Cargo test doc
    runs-on: ubuntu-latest

    steps:
      - name: Fetch Repository
        uses: actions/checkout@v5

      - name: Install stable toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1

      - name: Cargo test doc
        run: cargo test --doc --workspace --all-features

  cargo-next-test:
    name: Cargo test
    runs-on: ubuntu-latest

    steps:
      - name: Fetch Repository
        uses: actions/checkout@v5

      - name: Install stable toolchain
        uses: actions-rust-lang/setup-rust-toolchain@v1

      - name: Install cargo-nextest
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-nextest

      - name: Cargo test
        run: cargo nextest run --workspace --all-targets --all-features --no-tests=pass

  typos-cli:
    name: typos
    runs-on: ubuntu-latest

    steps:
      - name: Fetch Repository
        uses: actions/checkout@v5

      - name: Install Typos
        uses: taiki-e/install-action@v2
        with:
          tool: typos-cli

      - name: run typos
        run: typos

  taplo-toml-fmt:
    name: taplo fmt
    runs-on: ubuntu-latest

    steps:
      - name: Fetch Repository
        uses: actions/checkout@v5

      - name: Install Taplo
        uses: taiki-e/install-action@v2
        with:
          tool: taplo-cli

      - name: Run Taplo
        id: taplo
        run: taplo fmt --check --diff

  markdownlint:
    name: Markdown lint
    runs-on: ubuntu-latest

    steps:
      - name: Fetch Repository
        uses: actions/checkout@v5

      - name: markdownlint-cli2-action
        uses: DavidAnson/markdownlint-cli2-action@v20
        with:
          globs: "**/*.md"