-
Notifications
You must be signed in to change notification settings - Fork 340
45 lines (40 loc) · 1.12 KB
/
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
name: Pre-commit Checks
on:
push:
branches:
- trunk
- release-*
pull_request:
jobs:
bidi_scan_job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '32'
- name: Run BiDi Scan
run: |
git fetch origin trunk
CHANGED_FILES=$(git diff --name-only --relative --diff-filter AMR origin/trunk -- . | tr '\n' ' ')
if [ -z "${CHANGED_FILES}" ]; then
echo --- No changed files
else
python ${{github.workspace}}/scripts/find_unicode_control.py -p bidi -v ${CHANGED_FILES}
fi
clang_format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '32'
- name: Install clang-format
run: sudo apt-get install -y clang-format
- name: Run clang-format
run: |
git diff -U0 --no-color HEAD^1 *.c *.cc *.cpp *.h *.hpp *.i *.ic *.ih | clang-format-diff -style=file -p1 >_GIT_DIFF
if [ ! -s _GIT_DIFF ]; then
echo The last git commit is clang-formatted;
else
cat _GIT_DIFF;
false;
fi