name: Tests

on: [push, pull_request]

jobs:

  tests:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        python: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-2.7', 'pypy-3.6', 'pypy-3.7', 'pypy-3.8']
        exclude:
          - os: macos-latest
            python: 'pypy-3.6'  # Not installable
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

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

      - name: Install dependencies
        run: python -m pip install flake8 pytest pytest-cov

      - name: Flake8 linter
        run: python -m flake8

      - name: Unit tests
        run: python -m pytest --cov

name: Tests

on: [push, pull_request]

jobs:

  tests:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        python: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-2.7', 'pypy-3.6', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9']
        exclude:
          - os: macos-latest
            python: 'pypy-3.6'  # Not installable
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

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

      - name: Install dependencies
        run: python -m pip install flake8 pytest pytest-cov

      - name: Flake8 linter
        run: python -m flake8

      - name: Unit tests
        run: python -m pytest --cov

      - name: Coverage report
        if: matrix.os == 'ubuntu-latest' && matrix.python == '3.10'
        run: coverage lcov

      - name: Coveralls
        uses: coverallsapp/github-action@master
        if: matrix.os == 'ubuntu-latest' && matrix.python == '3.10'
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          path-to-lcov: coverage.lcov

Add Coveralls to GitHub Actions workflow
Add Coveralls to GitHub Actions workflow
