-
Notifications
You must be signed in to change notification settings - Fork 10
65 lines (52 loc) · 1.46 KB
/
check-code-quality.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
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <[email protected]>
#
# SPDX-License-Identifier: MPL-2.0
name: Check Code Quality
on:
push:
branches:
- main
# run pipeline on pull request
pull_request:
# run pipeline on merge queue
merge_group:
# run pipeline from another workflow
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-code-quality
cancel-in-progress: true
jobs:
check-code-quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Upgrade pip
run: pip install --upgrade pip
- name: Install and run isort
run: |
pip install isort
isort .
- name: Install and run black
run: |
pip install black[jupyter]
black .
- name: Install and run mypy
run: |
pip install mypy
mypy src
- name: Install and run pylint
run: |
pip install pylint .
pylint power_grid_model_io
- name: If needed raise error
run: |
if [[ `git status --porcelain --untracked-files=no` ]]; then
echo "Formatting not correct! See below the files which need to be reformatted!"
git status --porcelain --untracked-files=no
exit 1
fi