name: pre-commit

on:
  pull_request:
  push:
    branches: [main]

jobs:
  pre-commit:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        # make sure python versions are consistent with those used in .circleci/config.yml
        python-version: ['3.7.12', '3.8.12', '3.9.7']
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - uses: pre-commit/action@v2.0.3
