Python Tests #2102
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
# workflow to run the acme2certifier unittest suite | |
name: Python Tests | |
on: | |
push: | |
pull_request: | |
branches: [ devel ] | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- 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'] | |
name: Python Unittest (${{ matrix.python_version }}) | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python_version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- name: Install components | |
run: | | |
sudo DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -y \ | |
libkrb5-dev \ | |
python3-gssapi \ | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: cp | |
run: | | |
cp examples/ca_handler/skeleton_ca_handler.py acme_srv/ca_handler.py | |
cp examples/acme_srv.cfg acme_srv/ | |
- 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'] | |
name: Pylint test (${{ matrix.python_version }}) | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python_version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python_version }} | |
- name: Install components | |
run: | | |
sudo DEBIAN_FRONTEND="noninteractive" apt-get install --no-install-recommends -y \ | |
libkrb5-dev \ | |
python3-gssapi \ | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pylint pylint-exit | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: cp | |
run: | | |
cp examples/ca_handler/skeleton_ca_handler.py acme_srv/ca_handler.py | |
cp examples/db_handler/wsgi_handler.py acme_srv/db_handler.py | |
cp examples/acme_srv.cfg acme_srv/ | |
- name: "Pylint folder: acme" | |
run: | | |
pylint --rcfile=".github/pylintrc" acme_srv/ || pylint-exit $? | |
- name: "Pylint folder: tools" | |
run: | | |
pylint --rcfile=".github/pylintrc" tools/*.py || pylint-exit $? | |
- name: "Pylint folder: examples/db_handler" | |
run: | | |
pylint --rcfile=".github/pylintrc" examples/db_handler/*.py || pylint-exit $? | |
- name: "Pylint folder: examples/ca_handler" | |
run: | | |
pylint --rcfile=".github/pylintrc" examples/ca_handler/*.py || pylint-exit $? | |
- name: "Linting with pycodestyle" | |
run: | | |
pip install pycodestyle | |
cp .github/pycodestyle ~/.config/pycodestyle | |
pycodestyle --show-source examples/. | |
pycodestyle --show-source acme_srv/. | |
pycodestyle --show-source tools/. |