#53: Updated requirements #142
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: [push] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: | |
- 'python:2.7-buster' | |
- 'python:3.4-stretch' | |
- 'python:3.5-buster' | |
- 'python:3.6-bullseye' | |
- 'python:3.7-bookworm' | |
- 'python:3.8-bookworm' | |
- 'python:3.9-bookworm' | |
- 'python:3.10-bookworm' | |
- 'python:3.11-bookworm' | |
- 'python:3.12-bookworm' | |
container: | |
image: ${{ matrix.image }} | |
env: | |
PYTHON: ${{ matrix.python-version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set environment variables | |
run: | | |
echo "PYTHON=$(echo '${{ matrix.image }}' | sed -r 's/^python:([0-9]+)\.([0-9]+).*$/\1.\2/g')" >> $GITHUB_ENV | |
echo "TOXFACTOR=$(echo '${{ matrix.image }}' | sed -r 's/^python:([0-9]+)\.([0-9]+).*$/py\1\2/g')" >> $GITHUB_ENV | |
- name: Install importlib-metadata for older Python versions | |
run: pip install "importlib-metadata<3" | |
if: >- | |
matrix.image == 'python:2.7-buster' || | |
matrix.image == 'python:3.4-stretch' || | |
matrix.image == 'python:3.5-buster' || | |
matrix.image == 'python:3.6-bullseye' || | |
matrix.image == 'python:3.7-bookworm' | |
- name: Install test utilities | |
run: pip install "tox<4" tox-factor "coverage<5" | |
- name: Lint with flake8 | |
run: tox -e flake8 | |
if: matrix.image == 'python:3.12-bookworm' | |
- name: Test via tox | |
run: tox -- -p no:warnings | |
- name: Generate coverage report | |
run: coverage html | |
if: ${{ success() }} | |
- name: Upload coverage data | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: htmlcov | |
if-no-files-found: ignore | |
if: ${{ success() }} |