on:
  push:
    branches: [ master, multi-os-testing ]
  pull_request:
    branches: [ master ]

jobs:
  pre-commit:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        # Checkout pull request HEAD commit instead of merge commit
        ref: ${{ github.event.pull_request.head.sha }}
        fetch-depth: 0
    - uses: actions/setup-python@v2
    - uses: pre-commit/action@v2.0.0
      with:
        token: ${{ secrets.GITHUB_TOKEN }}

  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        python-version: [3.6, 3.7, 3.8, 3.9]

    steps:
    - uses: actions/checkout@v2

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements-dev.txt

    - name: Test with pytest
      run: |
        pytest

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  pre-commit:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        # Checkout pull request HEAD commit instead of merge commit
        ref: ${{ github.event.pull_request.head.sha }}
        fetch-depth: 0
    - uses: actions/setup-python@v2
    - uses: pre-commit/action@v2.0.0
      with:
        token: ${{ secrets.GITHUB_TOKEN }}

  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        python-version: [3.6, 3.7, 3.8, 3.9]

    steps:
    - uses: actions/checkout@v2

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements-dev.txt

    - name: Test with pytest
      run: |
        pytest

Revert "Check a PR-less build"
Revert "Check a PR-less build"

This reverts commit 57cc3241fbd3d27d769f3c029bd66557635584ad.
