Skip to content

fix: code coverage work with poetry and add coverage.json gitignore #271

fix: code coverage work with poetry and add coverage.json gitignore

fix: code coverage work with poetry and add coverage.json gitignore #271

Workflow file for this run

# This GitHub Actions workflow contains two jobs:
# -- First, Lint uses the latest Ubuntu image and Python 3.8 to check the code
# and writing for defects, using the Pipenv linting script and mdl
#
# -- Second, Test uses a strategy matrix to run the Pipenv test scripts for
# multiple platform configurations, and then uploads test coverage.
name: Lint and Test
on: [push, pull_request]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Python 3.11
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.5.1
- name: Setup Poetry
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
poetry env info
- name: Install dependencies
run: poetry install --no-interaction --no-ansi
- name: Lint code
run: poetry run task lint
- name: Lint writing
uses: actionshub/markdownlint@main
test:
# Test uses a strategy matrix to ensure that sufficient platform test
# coverage is reached. For this configuration, we run the latest Ubuntu
# image with Python 3.6 and 3.9, while also including MacOS + Python 3.8 and
# Windows + Python 3.7. With this spread, we achieve testing of four
# different Python versions and three operating systems without running the
# full twelve possible combinations, greatly reducing load and usage.
name: Test
runs-on: ${{ matrix.os }}
strategy:
# Turning fail-fast off ensures the entire strategy matrix is allowed to
# run to completion, allowing detection of individual platform issues
# regardless of the status of the other platforms.
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
include:
- os: macos-latest
python-version: "3.11"
- os: windows-latest
python-version: "3.11"
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: Gr1N/setup-poetry@v8
with:
poetry-version: 1.5.1
- name: Setup Poetry
run: |
poetry --version
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
poetry env info
- name: Install dependencies
run: poetry install --no-interaction --no-ansi
- name: Execute tests
if: matrix.os != 'windows-latest'
run: poetry run task test