name: Style check

on:
  # Trigger on pull requests.
  pull_request:

  # Trigger on pushes to the mainline branches and version tags. This prevents building commits
  # twice when the pull request source branch is in the same repository.
  push:
    branches:
      - "maint"
      - "master"

  # Trigger on request.
  workflow_dispatch:

jobs:
  style_checks:
    name: Run ${{ matrix.name }}
    runs-on: ubuntu-latest
    container:
      image: glotzerlab/ci:2021.03-clang10_py38
      options: -u 0
    strategy:
      matrix:
        include:
          - name: clang_format
            command: ./run-clang-format.py -r scripts gsd
          - name: flake8
            command: flake8
          - name: yapf
            command: yapf -d -r .
    steps:
      - uses: actions/checkout@v2.3.4
      - name: Configure
        run: cmake -B build
      - name: Execute ${{ matrix.name }}
        run: ${{ matrix.command }}

  # This job is used to provide a single requirement for branch merge conditions.
  checks_complete:
    name: Style check
    if: always()
    needs: [style_checks]
    runs-on: ubuntu-latest

    steps:
      - run: echo "Done!"

Add style check GitHub Actions workflow
Add style check GitHub Actions workflow
