update publish.yml #14
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: Build and test package | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
build: | |
name: Test with ${{matrix.python-version}} on Ubuntu | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python: ["3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry flake8 | |
poetry install --with dev | |
- name: Lint with Flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 freesif/ --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 freesif/ --count --exit-zero --per-file-ignores=__init__.py:F401 --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test and report coverage | |
run: | | |
# List terminal lines with missing test | |
poetry run pytest -s tests/ --cov=freesif --cov-report=term-missing | |
# future: add --cov-fail-under=95 to fail if coverage is less than 95% | |