| 1 |
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
| 2 |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 |
|
| 4 |
name: Python package Ubuntu |
| 5 |
|
| 6 |
on: |
| 7 |
push: |
| 8 |
pull_request: |
| 9 |
|
| 10 |
jobs: |
| 11 |
build: |
| 12 |
defaults: |
| 13 |
run: |
| 14 |
working-directory: . |
| 15 |
|
| 16 |
runs-on: ubuntu-latest |
| 17 |
strategy: |
| 18 |
matrix: |
| 19 |
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] |
| 20 |
|
| 21 |
steps: |
| 22 |
- uses: actions/checkout@v3 |
| 23 |
- name: Set up Python ${{ matrix.python-version }} |
| 24 |
uses: actions/setup-python@v3 |
| 25 |
with: |
| 26 |
python-version: ${{ matrix.python-version }} |
| 27 |
- name: Set up Perl version for package build |
| 28 |
uses: shogo82148/actions-setup-perl@v1 |
| 29 |
with: |
| 30 |
perl-version: "5.32" |
| 31 |
- name: Install dependencies |
| 32 |
run: | |
| 33 |
python -m pip install --upgrade pip |
| 34 |
pip install flake8 |
| 35 |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 36 |
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi |
| 37 |
- name: Lint with flake8 |
| 38 |
run: | |
| 39 |
# stop the build if there are Python syntax errors or undefined names |
| 40 |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 41 |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 42 |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 43 |
- name: Build and install with pip |
| 44 |
run: | |
| 45 |
pip install . |
| 46 |
- name: Test of run_tests.py |
| 47 |
run: | |
| 48 |
python run_tests.py |
| 49 |
- name: Run end to end tests with e2etest.py |
| 50 |
run: | |
| 51 |
mkdir empty |
| 52 |
cd empty |
| 53 |
pip install -r ../e2etest/requirements_e2e.txt |
| 54 |
python ../e2etest/e2etest.py |