-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (65 loc) · 1.94 KB
/
quality_control.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: PBM Code Quality
on: [pull_request]
jobs:
type_validation:
name: Mypy Type Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Poetry
run: python -m pip install poetry
- name: Run Mypy
run: |
poetry install
poetry run mypy --check-untyped-defs power_balance/
modelica_syntax_validation:
name: Modelica Syntax Checking
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Modelica Code Check
run: |
git clone https://github.com/modelica-tools/ModelicaSyntaxChecker.git
${GITHUB_WORKSPACE}/ModelicaSyntaxChecker/Linux64/moparser -c -l -r power_balance/
bandit_security_check:
name: Bandit Security Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: jpetrucciani/bandit-check@master
with:
bandit_flags: '-c bandit.yml'
path: power_balance
import_sort:
name: Run Python Import Order Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Check Imports
uses: isort/isort-action@master
with:
configuration: '--check-only --diff --profile black'
black_linter:
name: Run Black Python Linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check Code with Black
uses: psf/black@stable
with:
src: power_balance
unused_imports:
name: Run Unused Python Import Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install Unimport
run: python -m pip install unimport
- name: Check Imports
run: unimport --check --diff --include power_balance