mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-12-22 15:18:54 +01:00
I have found out that the python setup action supports the use of the poetry cache which increases the build speed.
72 lines
1.8 KiB
YAML
72 lines
1.8 KiB
YAML
name: Python-Lint
|
|
|
|
on:
|
|
push:
|
|
|
|
jobs:
|
|
Black:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v4
|
|
- name: Run black
|
|
uses: psf/black@stable
|
|
with:
|
|
options: --check --diff --color --fast
|
|
src: ./src ./tests
|
|
|
|
mypy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install poetry
|
|
run: pipx install poetry
|
|
- name: Set up python
|
|
id: setup-python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.11'
|
|
cache: poetry
|
|
- run: poetry install --without develop,doc --all-extras
|
|
- name: Run mypy
|
|
run: |
|
|
poetry run mypy src tests
|
|
|
|
ruff:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: chartboost/ruff-action@v1
|
|
with:
|
|
version: 0.1.0
|
|
|
|
python-requirements:
|
|
name: Check Python Requirements
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install poetry
|
|
run: pipx install poetry
|
|
- name: Set up python
|
|
id: setup-python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.11'
|
|
cache: poetry
|
|
- run: poetry install --without develop,doc --all-extras
|
|
- name: Poetry export
|
|
run: poetry export -f requirements.txt --output requirements.txt
|
|
- name: Check license
|
|
run: |
|
|
poetry run pip-licenses --format=markdown --output-file=license-summary.md
|
|
- name: Archive license summary
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: license-summary
|
|
path: |
|
|
license-summary.md
|
|
requirements.txt
|
|
- name: Check requirements security with pip-audit
|
|
run: |
|
|
poetry run pip-audit --format markdown -o lbr-audit.md
|