name: Tests

on:
  push:
    branches:
      - master
  pull_request:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        python-version: [3.6, 3.7, 3.8, 3.9, '3.10', 3.11, '3.12-dev']
    steps:
    - uses: actions/checkout@v3
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.python-version }}
    - name: run tests
      env:
        STACK_DATA_SLOW_TESTS: 1
      run: |
        pip install --upgrade pip
        pip install --upgrade coveralls setuptools setuptools_scm pep517
        pip install .[tests]
        coverage run --source stack_data -m pytest
        coverage report -m
    - name: Coveralls Python
      uses: AndreMiras/coveralls-python-action@v20201129
      with:
        parallel: true
        flag-name: test-${{ matrix.python-version }}
  coveralls_finish:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - name: Coveralls Finished
        uses: AndreMiras/coveralls-python-action@v20201129
        with:
          parallel-finished: true
