row 1.0.0

Row is a command line tool that helps you manage workflows on HPC resources.
Documentation
name: Style

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

on:
  pull_request:
  push:
    branches:
    - trunk

  workflow_dispatch:

env:
  name: row
  CARGO_TERM_COLOR: always
  CLICOLOR: 1

jobs:
  cargo-check:
    runs-on: ubuntu-24.04
    steps:
    - name: Checkout
      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
    - name: Configure Rust
      uses: dtolnay/rust-toolchain@0f44b27771c32bda9f458f75a1e241b09791b331
      with:
        toolchain: 1.91.1
    - name: Cache
      uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
      with:
        cache-bin: false
    - run: cargo check --all-targets --all-features

  cargo-clippy:
    runs-on: ubuntu-24.04
    steps:
    - name: Checkout
      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
    - name: Configure Rust
      uses: dtolnay/rust-toolchain@0f44b27771c32bda9f458f75a1e241b09791b331
      with:
        toolchain: 1.91.1
        components: clippy
    - name: Cache
      uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
      with:
        cache-bin: false
    - run: cargo clippy --all-targets --all-features -- -Dwarnings

  cargo-fmt:
    runs-on: ubuntu-24.04
    steps:
    - name: Checkout
      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
    - name: Configure Rust
      uses: dtolnay/rust-toolchain@0f44b27771c32bda9f458f75a1e241b09791b331
      with:
        toolchain: 1.91.1
        components: rustfmt
    - run: cargo fmt --check

  prek:
    runs-on: ubuntu-24.04
    steps:
    - name: Checkout
      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
    - name: prek
      uses: glotzerlab/workflows/prek@894d9678188a02b06560fdeb2b9ba98d016cd371 # 0.10.0

  # This job is used to provide a single requirement for branch merge conditions.
  tests_complete:
    name: All style checks
    if: always()
    needs: [cargo-check, cargo-clippy, cargo-fmt, prek]
    runs-on: ubuntu-24.04

    steps:
    - run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
    - name: Done
      run: exit 0