forked from KhronosGroup/Vulkan-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (63 loc) · 2.75 KB
/
check.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
name: Quality Checks
on:
pull_request:
branches: [main]
env:
TARGET_BRANCH: main
jobs:
doxygen:
name: Doxygen Syntax Check
container: ghcr.io/khronosgroupactions/doxygen:1.9.5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: mkdir -p doxygen
- run: doxygen docs/doxygen/doxyfile
- run: if [ $(stat -c%s doxygen/warnings.txt) -gt 0 ]; then cat doxygen/warnings.txt; exit 1; fi
copyright_headers:
name: Copyright Headers Check
container: ghcr.io/khronosgroupactions/copyright-check:latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: git config --global --add safe.directory /__w/Vulkan-Samples/Vulkan-Samples
- run: git fetch origin $TARGET_BRANCH:$TARGET_BRANCH
- run: python3 /usr/local/bin/check_copyright_headers.py $TARGET_BRANCH
snake_case_check:
name: Snake Case Check
container: ghcr.io/khronosgroupactions/snake-case-check:latest
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- run: python3 /usr/local/bin/snake_case_check.py $TARGET_BRANCH > snake-report.txt
- run: if [ $(grep -c '@@' snake-report.txt) -gt 0 ]; then cat snake-report.txt; exit 1; fi
clang_format:
name: Clang Format Check
container: ghcr.io/khronosgroupactions/clang-tools:15.0.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: git config --global --add safe.directory /__w/Vulkan-Samples/Vulkan-Samples
- run: git fetch origin $TARGET_BRANCH:$TARGET_BRANCH
- name: Run Clang Format diff
id: clang-diff
run: echo "changes=$(echo $(git diff -U0 --no-color $TARGET_BRANCH | python3 /usr/share/clang/clang-format-diff.py -p1 -v -sort-include))" >> $GITHUB_OUTPUT
- name: Count Diff Lines
continue-on-error: true
id: count-diff
run: echo "line-count=$(echo "${{ steps.clang-diff.outputs.changes }}" | grep -c +++)" >> $GITHUB_OUTPUT
- name: Assert
run: if test ${{ steps.count-diff.outputs.line-count }} -gt 0; then echo "${{ steps.clang-diff.outputs.changes }}"; exit 1; fi
clang_tidy:
name: Clang Tidy Check
container: ghcr.io/khronosgroupactions/clang-tools:15.0.0
runs-on: ubuntu-latest
continue-on-error: true # we currently dont track clang-tidy warnings as errors. in the future this will change
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
- run: git config --global --add safe.directory /__w/Vulkan-Samples/Vulkan-Samples
- run: cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -H. -Bbuild/clang
- run: /usr/bin/run-clang-tidy -j $(($(nproc)/2+1)) -p build/clang -header-filter=framework,samples,app -checks=-*,google-*,-google-runtime-references -quiet framework/* samples/* app/* tests/*