Skip to content

Python Tests

Python Tests #628

Workflow file for this run

# workflow to run the dkb-robo unittest suite
name: Python Tests
on:
push:
pull_request:
branches: [ devel ]
schedule:
- cron: '0 2 * * 6'
jobs:
unittest:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: [3.x, 3.12, 3.11, '3.10', 3.9, 3.8, 3.7]
name: Python Unittest (${{ matrix.python_version }})
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install lxml beautifulsoup4 html5lib
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Python test
run: |
pytest
pylint:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: [3.x, 3.12, 3.11, '3.10', 3.9, 3.8, 3.7]
name: Pylint test (${{ matrix.python_version }})
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
sudo apt-get install libxml2-dev libxslt-dev python-dev-is-python3
python -m pip install --upgrade pip
pip install pylint pylint-exit mechanicalsoup
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: "Pylint folder: dkb_robo"
run: |
pylint --rcfile=".github/pylintrc" dkb_robo/ || pylint-exit $?
- name: Lint with pycodestyle
run: |
pip install pycodestyle
pycodestyle --max-line-length=380 dkb_robo/.