documentation #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
- push | |
- pull_request | |
jobs: | |
tests: | |
name: "Python ${{ matrix.python-version }} on ${{ matrix.platform }}" | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
matrix: | |
platform: [ubuntu-latest, macos-latest] | |
python-version: ['3.8', '3.9', '3.10', '3.11'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install tox tox-gh-actions | |
- name: Test with tox | |
run: tox | |
# this crudely re-runs a subset of tests again but with coverage tracking | |
# was having a lot of trouble getting coverage to correctly count lines | |
# when running parallel tests, even with combining the coverage files | |
code-coverage: | |
needs: tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install pytest | |
python -m pip install coverage | |
python -m pip install . | |
- name: Test with pytest | |
run: | | |
coverage run --source=${{ github.workspace }} --module pytest | |
coverage report -m | |
coverage xml | |
- name: Coveralls GitHub Action | |
uses: coverallsapp/github-action@v2.2.3 | |
with: | |
file: coverage.xml |