mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-04-24 17:32:33 +02:00
This change will change the pipline to limit duplicat execution of tests and lint actions in pull requests to save computing time.
89 lines
2.2 KiB
YAML
89 lines
2.2 KiB
YAML
name: Python-Lint
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
types: [reopened, opened]
|
|
|
|
jobs:
|
|
Black:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up python
|
|
id: setup-python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.11'
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v3
|
|
- run: pip install black
|
|
- name: Run black
|
|
run: |
|
|
black src tests
|
|
|
|
mypy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up python
|
|
id: setup-python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.11'
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v3
|
|
- name: Install and configure Poetry
|
|
uses: snok/install-poetry@v1
|
|
with:
|
|
version: 1.4.2
|
|
virtualenvs-create: false
|
|
virtualenvs-path: ~/local/share/virtualenvs
|
|
- run: poetry install --without develop,doc
|
|
- name: Run mypy
|
|
run: |
|
|
mypy src tests
|
|
|
|
ruff:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: chartboost/ruff-action@v1
|
|
with:
|
|
version: 0.0.290
|
|
|
|
python-requirements:
|
|
name: Check Python Requirements
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up python
|
|
id: setup-python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.11'
|
|
- name: Install and configure Poetry
|
|
uses: snok/install-poetry@v1
|
|
with:
|
|
version: 1.4.2
|
|
virtualenvs-create: true
|
|
virtualenvs-path: ~/local/share/virtualenvs
|
|
- name: Check out Git repository
|
|
uses: actions/checkout@v3
|
|
- name: Install root, pip-licenses & pip-audit
|
|
run: |
|
|
poetry install --only-root
|
|
poetry run pip install pip-licenses pip-audit
|
|
- 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
|