Skip to content

Merge pull request #13 from nokia/dependabot/pip/idna-3.7 #75

Merge pull request #13 from nokia/dependabot/pip/idna-3.7

Merge pull request #13 from nokia/dependabot/pip/idna-3.7 #75

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on: [push]
jobs:
build:
strategy:
matrix:
# Only use python version matching libboost_python*.so lib
# 3.8 for ubuntu 20.04
# 3.10 for ubuntu 22.04
# ...
# Unfortunately, 3.x does not work for ubuntu-latest
python-version: ["3.11"]
# poetry-version >= 1.2 is required to support groups
poetry-version: ["1.3.2"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
# https://github.com/marketplace/actions/python-poetry-action
- name: Checkout
uses: actions/checkout@v3
# https://github.com/actions/setup-python/issues/529
# https://github.com/actions/setup-python#caching-packages-dependencies
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Run image
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install graphviz
run: |
sudo apt install graphviz
- name: Install Python dependencies
run: |
poetry install --with dev,test
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 src/ --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 src/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run tests and generate coverage report
run: |
# tox -e py
poetry run coverage run -m pytest
poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3