Skip to content

Exclude python 3.6 for macos. Actually use the python-version. Add latest python-versions #44

Exclude python 3.6 for macos. Actually use the python-version. Add latest python-versions

Exclude python 3.6 for macos. Actually use the python-version. Add latest python-versions #44

Workflow file for this run

# This workflow will run tests on PRs
name: PyTest On PR
on:
pull_request:
branches:
- master
jobs:
test:
name: ${{ matrix.platform }} / ${{ matrix.python-version }}
strategy:
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
platform:
- ubuntu-20.04
- macos-latest
- windows-latest
exclude:
# 3.6, 3.7 doesn't exist as a runner on arm64 macs
- python-version: 3.6
platform: macos-latest
- python-version: 3.7
platform: macos-latest
runs-on: "${{ matrix.platform }}"
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.6
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
- name: Setup poetry
uses: abatilo/actions-poetry@v2
- name: Update PATH
if: ${{ matrix.platorm != 'windows-latest' }}
shell: bash
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Update Path for Windows
if: ${{ matrix.platform == 'windows-latest' }}
shell: bash
run: echo "$APPDATA\\Python\\Scripts" >> $GITHUB_PATH
- name: Configure poetry
shell: bash
run: poetry config virtualenvs.in-project true
- name: Poetry check & build
shell: bash
run: poetry check && poetry build
- name: Install dependencies
shell: bash
run: poetry install
- name: Mypy
shell: bash
run: poetry run mypy .
- name: Mypy
shell: bash
run: poetry run pylint coverage_lcov tests
- name: PyTest
shell: bash
run: poetry run coverage run --source=coverage_lcov -m pytest tests && poetry run coverage report
- name: Eat our own dog food
shell: bash
run: poetry run coverage-lcov
- name: Report code coverage
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.9' }}
uses: zgosalvez/github-actions-report-lcov@v1
with:
coverage-files: lcov.info
minimum-coverage: 0
artifact-name: code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
working-directory: coverage_lcov