-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (55 loc) · 1.46 KB
/
python.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
name: Python
on:
push:
branches:
- main
pull_request:
jobs:
pylint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v3
- name: Get Diff Action
uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
+(scripts|resources|bfasst)/**/*.py
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
if: env.GIT_DIFF
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
if: env.GIT_DIFF
- name: Check for syntax errors with pylint
run: |
pylint --errors-only $(git ls-files --directory scripts --directory bfasst | grep -e ".py$")
if: env.GIT_DIFF
- name: Analysing the code with pylint
run: |
pylint ${{ env.GIT_DIFF_FILTERED }}
if: env.GIT_DIFF
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Run format
run: |
make format
- name: Check for formatting errors
run: |
git diff --exit-code
if [ $? -eq 1 ]; then
echo "Formatting errors detected. Please run 'make format' and commit the changes."
exit 1
fi