Merge pull request #122 from dimaqq/docs/testing #236
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: test | |
on: [pull_request, push] | |
jobs: | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Run tox -e lint | |
run: tox | |
env: | |
TOXENV: lint | |
test: | |
name: unittests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toxenv: | |
- py37-dj22 | |
- py37-dj32 | |
- py39-dj22 | |
- py39-dj32 | |
- py39-dj40 | |
- py39-dj41 | |
- py39-dj42 | |
include: | |
- toxenv: py37-dj22 | |
python-version: 3.7 | |
- toxenv: py37-dj32 | |
python-version: 3.7 | |
- toxenv: py39-dj22 | |
python-version: 3.9 | |
- toxenv: py39-dj32 | |
python-version: 3.9 | |
- toxenv: py39-dj40 | |
python-version: 3.9 | |
- toxenv: py39-dj41 | |
python-version: 3.9 | |
- toxenv: py39-dj42 | |
python-version: 3.9 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Run tox | |
run: tox | |
env: | |
TOXENV: ${{ matrix.toxenv }} | |
- name: Store test coverage | |
if: matrix.toxenv != 'lint' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: coverage | |
path: .coverage.* | |
coverage: | |
name: coverage | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Retrieve test coverage | |
uses: actions/download-artifact@v2 | |
with: | |
name: coverage | |
- name: Check coverage | |
run: tox -e coverage |