-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (96 loc) · 2.92 KB
/
code-quality.yml
File metadata and controls
116 lines (96 loc) · 2.92 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Code Quality
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
clang-tidy:
name: clang-tidy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
clang \
clang-tidy \
pkg-config \
libgtk-3-dev \
libgl1-mesa-dev \
libglew-dev \
libx11-dev \
libxrandr-dev \
libxcursor-dev \
libxi-dev \
libdbus-1-dev \
libfontconfig-dev \
libssl-dev \
libcurl4-openssl-dev \
libpulse-dev
- uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest
- uses: actions/cache@v4
with:
path: ~/.xmake/packages
key: ${{ runner.os }}-xmake-${{ hashFiles('xmake.lua') }}
restore-keys: ${{ runner.os }}-xmake-
- name: clang-tidy verify config
run: bash -c 'OUT=$(clang-tidy --dump-config 2>&1); echo "$OUT"; if echo "$OUT" | grep -q "error:"; then exit -1; fi'
- name: Configure (debug, clang)
run: xmake f -m debug --toolchain=clang -y
- name: Build (generates compile_commands.json)
run: xmake -b example_app
- name: Run clang-tidy
run: python3 .github/tidy-summary.py
valgrind:
name: valgrind
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
valgrind \
pkg-config \
libgtk-3-dev \
libgl1-mesa-dev \
libglew-dev \
libx11-dev \
libxrandr-dev \
libxcursor-dev \
libxi-dev \
libdbus-1-dev \
libfontconfig-dev \
libssl-dev \
libcurl4-openssl-dev \
libpulse-dev \
googletest \
libgtest-dev
- uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest
- uses: actions/cache@v4
with:
path: ~/.xmake/packages
key: ${{ runner.os }}-xmake-${{ hashFiles('xmake.lua') }}
restore-keys: ${{ runner.os }}-xmake-
- name: Configure (debug)
run: xmake f -m debug -y
- name: Build Tests
run: xmake -b Tests
- name: Run tests with valgrind
run: |
valgrind \
--suppressions=${{ github.workspace }}/valgrind_suppressions.supp \
--error-exitcode=1 \
--tool=memcheck \
--leak-check=full \
--track-origins=yes \
--gen-suppressions=all \
build/linux/x86_64/debug/Tests