-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (63 loc) · 2.31 KB
/
static_checks.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
70
71
72
73
name: 📊 Static Checks
on: [push, pull_request]
env:
CLANG_FORMAT_VERSION: "17"
BLACK_VERSION: "23.10"
jobs:
static-checks:
name: Static Checks (clang-format, black format, file format, documentation checks)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
#Install dependencies
sudo wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key |
sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ env.CLANG_FORMAT_VERSION }} main'
sudo apt-get update
sudo apt-get install -y \
recode \
dos2unix \
codespell \
clang-format-${{ env.CLANG_FORMAT_VERSION }}
sudo update-alternatives --remove-all clang-format
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-${{ env.CLANG_FORMAT_VERSION }} 100
python3 -m pip install black==${{ env.BLACK_VERSION }}
- name: File formatting checks (file_format.sh)
run: |
bash tools/scripts/file_format.sh
- name: Style checks via clang-format (clang_format.sh)
run: |
bash tools/scripts/clang_format.sh
- name: Python style checks via black (black_format.sh)
run: |
bash tools/scripts/black_format.sh
- name: Create patch file
if: failure()
run: |
git diff > static-checks.patch
- name: Upload patch file
if: failure()
uses: actions/upload-artifact@v4
with:
name: patch-files
path: |
static-checks.patch
- name: JavaScript style and documentation checks via ESLint and JSDoc
run: |
#JavaScript style and documentation checks
cd platform/web
npm ci
npm run lint
npm run docs -- -d dry-run
- name: Spelling checks (codespell)
run: |
codespell \
-I tools/codespell-ignore-words.txt \
-x tools/codespell-ignore-lines.txt \
docs modules/*/docs
- name: Documentation syntax checks
run: |
tools/scripts/rst_from_xml.py --dry-run docs modules