forked from gobo-eiffel/bdwgc
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 2.58 KB
/
Copy pathcppcheck.yml
File metadata and controls
59 lines (49 loc) · 2.58 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
# This workflow is to check C/C++ source with cppcheck.
name: cppcheck
on: [ push, pull_request ]
jobs:
check:
name: ${{ matrix.name }}
runs-on: ubuntu-22.04
strategy:
# Deliver the feedback for all matrix combinations.
fail-fast: false
matrix:
include:
- name: Check unused (basic)
args: --enable=unusedFunction --max-configs=200 --suppress=unusedFunction:libatomic_ops --suppress=unusedFunction:tests/gctest.c -D TEST_COVERAGE extra/gc.c tests/*.c
- name: Check unused (cord and tests)
args: --enable=unusedFunction --force --suppress=unusedFunction:cord/tests/de_win.c --suppress=unusedFunction:tests/gctest.c --suppress=unusedFunction:tests/cpp.cc -D GC_BUILTIN_ATOMIC -D TEST_COVERAGE *.cc cord/*.c cord/tests/*.c tests/*.c tests/*.cc
- name: All checks (A-M)
args: -j4 --enable=all --disable=missingInclude,unusedFunction --force -U GC_PRIVATE_H a*.c b*.c c*.c d*.c f*.c g*.c h*.c m*.c
- name: All checks (N-W and cord)
args: -j4 --enable=all --disable=missingInclude,unusedFunction --force -U GC_PRIVATE_H n*.c o*.c p*.c r*.c s*.c t*.c w*.c cord/*.c
- name: All checks (other)
args: -j4 --enable=all --disable=missingInclude,unusedFunction --force --suppress=functionStatic:include/gc/gc_allocator.h *.cc cord/tests/*.c extra/m*.c extra/*.cpp tests/*.c tests/*.cc tools/*.c
steps:
- uses: actions/checkout@v6
- name: Set cppcheck version
id: version
run: |
CPPCHECK_VER=2.20.0
echo "version=$CPPCHECK_VER" >> $GITHUB_OUTPUT
echo "cache_key=cppcheck-$CPPCHECK_VER" >> $GITHUB_OUTPUT
- name: Cache cppcheck
id: cache-cppcheck
uses: actions/cache@v5
with:
path: ~/cppcheck-install
key: ${{ steps.version.outputs.cache_key }}-${{ runner.os }}-${{ runner.arch }}
- name: Download and make cppcheck
if: steps.cache-cppcheck.outputs.cache-hit != 'true'
run: |
git clone --depth=1 https://github.com/cppcheck-opensource/cppcheck.git ~/cppcheck -b ${{ steps.version.outputs.version }}
make --directory ~/cppcheck -j8 CXXFLAGS="-O3 -march=native -D NDEBUG" FILESDIR=~/cppcheck-install PREFIX=~/cppcheck-install install
- name: Checkout libatomic_ops repository
uses: actions/checkout@v6
with:
repository: bdwgc/libatomic_ops
path: libatomic_ops
- name: Run cppcheck analysis
run: |
~/cppcheck-install/bin/cppcheck --error-exitcode=2 --quiet -D CPPCHECK -I include -I libatomic_ops/src --check-level=exhaustive --safety ${{ matrix.args }}