From 42933d9ae8e3faded870549dbe4c65999f1c6b8f Mon Sep 17 00:00:00 2001 From: Ruben van Staveren Date: Tue, 17 Mar 2026 20:39:20 +0100 Subject: [PATCH 1/2] Merge some actions in one file --- .gitea/workflows/bandit.yml | 36 ------------------- .gitea/workflows/flake8.yml | 35 ------------------ .gitea/workflows/pylint.yml | 35 ------------------ .../workflows/{mypy.yml => python-lint.yml} | 16 +++++++-- 4 files changed, 14 insertions(+), 108 deletions(-) delete mode 100644 .gitea/workflows/bandit.yml delete mode 100644 .gitea/workflows/flake8.yml delete mode 100644 .gitea/workflows/pylint.yml rename .gitea/workflows/{mypy.yml => python-lint.yml} (71%) diff --git a/.gitea/workflows/bandit.yml b/.gitea/workflows/bandit.yml deleted file mode 100644 index e70599d..0000000 --- a/.gitea/workflows/bandit.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: Bandit -on: - push: - branches: [main] - pull_request: - branches: [main] - -# XXX need to do stuff with uv -jobs: - audit-runtime-security: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: - - "3.11" - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '${{ matrix.python-version }}' - cache: 'pip' - cache-dependency-path: 'requirements.txt' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-dev.txt - - - name: Analyse code with Bandit - run: | - bandit -x '**/test_*.py,./.venv/**' -r . diff --git a/.gitea/workflows/flake8.yml b/.gitea/workflows/flake8.yml deleted file mode 100644 index 69ec686..0000000 --- a/.gitea/workflows/flake8.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: Flake8 -on: - push: - branches: [main] - pull_request: - branches: [main] - -# XXX need to do stuff with uv -jobs: - audit: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: - - "3.11" - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '${{ matrix.python-version }}' - cache: 'pip' - cache-dependency-path: 'requirements.txt' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-dev.txt - - name: Analyse code with Flake8 - run: | - flake8 $(git ls-files '*.py') diff --git a/.gitea/workflows/pylint.yml b/.gitea/workflows/pylint.yml deleted file mode 100644 index e43b69c..0000000 --- a/.gitea/workflows/pylint.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -name: Pylint -on: - push: - branches: [main] - pull_request: - branches: [main] - -# XXX need to do stuff with uv -jobs: - audit-runtime-security: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: - - "3.11" - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '${{ matrix.python-version }}' - cache: 'pip' - cache-dependency-path: 'requirements.txt' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-dev.txt - - name: Analyse code with Pylint - run: | - pylint $(git ls-files '*.py') diff --git a/.gitea/workflows/mypy.yml b/.gitea/workflows/python-lint.yml similarity index 71% rename from .gitea/workflows/mypy.yml rename to .gitea/workflows/python-lint.yml index 0409561..324a0c7 100644 --- a/.gitea/workflows/mypy.yml +++ b/.gitea/workflows/python-lint.yml @@ -1,5 +1,5 @@ --- -name: Mypy +name: Linting on: push: branches: [main] @@ -8,7 +8,7 @@ on: # XXX need to do stuff with uv jobs: - audit-typing: + linting: runs-on: ubuntu-latest strategy: matrix: @@ -31,6 +31,18 @@ jobs: pip install -r requirements.txt pip install -r requirements-dev.txt + - name: Analyse code with Pylint + run: | + pylint $(git ls-files '*.py') + + - name: Analyse code with Flake8 + run: | + flake8 $(git ls-files '*.py') + - name: Analyse code with Mypy run: | mypy --install-types --non-interactive $(git ls-files '*.py') + + - name: Analyse code with Bandit + run: | + bandit -x '**/test_*.py,./.venv/**' -r . -- 2.52.0 From 0b1018a81b2c8951bf98963f106dac82780563d2 Mon Sep 17 00:00:00 2001 From: Ruben van Staveren Date: Tue, 17 Mar 2026 20:41:16 +0100 Subject: [PATCH 2/2] Also move test+coverage inside --- .gitea/workflows/python-coverage.yml | 50 ---------------------------- .gitea/workflows/python-lint.yml | 42 +++++++++++++++++++++++ 2 files changed, 42 insertions(+), 50 deletions(-) delete mode 100644 .gitea/workflows/python-coverage.yml diff --git a/.gitea/workflows/python-coverage.yml b/.gitea/workflows/python-coverage.yml deleted file mode 100644 index 565d8df..0000000 --- a/.gitea/workflows/python-coverage.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Python Coverage - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - test-and-coverage: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: - - "3.11" - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '${{ matrix.python-version }}' - cache: 'pip' - cache-dependency-path: 'requirements.txt' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r requirements-dev.txt - - - name: Run tests with coverage - run: | - pytest --cov=./ --cov-report=term --cov-report=xml --cov-report=html --junitxml=report.xml tests - - - name: Upload coverage artifacts - uses: actions/upload-artifact@v3 - with: - name: coverage-reports - path: | - coverage.xml - htmlcov/ - - - name: Upload test results - uses: actions/upload-artifact@v3 - with: - name: test-results - path: report.xml diff --git a/.gitea/workflows/python-lint.yml b/.gitea/workflows/python-lint.yml index 324a0c7..aeb6ce3 100644 --- a/.gitea/workflows/python-lint.yml +++ b/.gitea/workflows/python-lint.yml @@ -46,3 +46,45 @@ jobs: - name: Analyse code with Bandit run: | bandit -x '**/test_*.py,./.venv/**' -r . + + test-and-coverage: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - "3.11" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '${{ matrix.python-version }}' + cache: 'pip' + cache-dependency-path: 'requirements.txt' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r requirements-dev.txt + + - name: Run tests with coverage + run: | + pytest --cov=./ --cov-report=term --cov-report=xml --cov-report=html --junitxml=report.xml tests + + - name: Upload coverage artifacts + uses: actions/upload-artifact@v3 + with: + name: coverage-reports + path: | + coverage.xml + htmlcov/ + + - name: Upload test results + uses: actions/upload-artifact@v3 + with: + name: test-results + path: report.xml -- 2.52.0