| 1 | name: Run Tox tests |
| 2 | |
| 3 | on: push |
| 4 | |
| 5 | jobs: |
| 6 | build: |
| 7 | runs-on: ${{ matrix.os }} |
| 8 | strategy: |
| 9 | matrix: |
| 10 | os: [ubuntu-latest, windows-latest] |
| 11 | python-version: [3.8] |
| 12 | name: Test on Python ${{ matrix.python-version }} |
| 13 | steps: |
| 14 | - uses: actions/checkout@v2 |
| 15 | - name: Setup python |
| 16 | uses: actions/setup-python@v1 |
| 17 | with: |
| 18 | python-version: ${{ matrix.python-version }} |
| 19 | architecture: x64 |
| 20 | - name: Install dependencies |
| 21 | run: | |
| 22 | pip install -U pip |
| 23 | pip install tox tox-gh-actions coveralls |
| 24 | - name: Test project with tox |
| 25 | run: | |
| 26 | tox |
| 27 | coveralls |
| 28 | env: |
| 29 | COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
| 30 | COVERALLS_PARALLEL: true |
| 31 | COVERALLS_FLAG_NAME: py-${{ matrix.python-version }}-${{ matrix.os }} |
| 32 | PYTEST_ADDOPTS: --cov-config=pyproject.toml --cov --cov-append |
| 33 | finish: |
| 34 | runs-on: ubuntu-latest |
| 35 | name: finish parallel build |
| 36 | needs: build |
| 37 | steps: |
| 38 | - name: Tell Coveralls that the parallel build is finished |
| 39 | run: | |
| 40 | curl -k \ |
| 41 | https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN \ |
| 42 | -d "payload[build_num]=$GITHUB_SHA&payload[status]=done" |
| 43 | env: |
| 44 | COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |