-
-
Notifications
You must be signed in to change notification settings - Fork 157
49 lines (41 loc) · 1.23 KB
/
format-lint.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
name: python3 setup.py lint
# Run lint CI on changes to main branch, or any PR to main. Do not run CI on
# any other branch.
# run only if there are changes on files that are linted (C, python and rst files)
on:
push:
branches: main
paths:
- '**.h'
- '**.c'
- '**.py'
- '**.rst'
pull_request:
branches: main
paths:
- '**.h'
- '**.c'
- '**.py'
- '**.rst'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-format-lint
cancel-in-progress: true
jobs:
format-lint-code-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- name: Install deps
run: python3 -m pip install pylint black clang-format sphinx"<7.2.0"
- name: Check code Formatting and Linting
run: python3 setup.py lint
- name: Check docs changes are checked in
run: |
python3 setup.py docs
if [[ `git status --porcelain` ]]; then
echo "Generating docs caused changes. Please check them in."
echo "You may need to run: python3 setup.py docs --fullgeneration"
# Run git status again, so people can see what changed.
git status --porcelain
exit 1
fi