Skip to content

Commit afcdf96

Browse files
committed
added scheduled self-checks with all available project imports to CI
1 parent b99ce96 commit afcdf96

1 file changed

Lines changed: 86 additions & 0 deletions

File tree

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
2+
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
3+
name: selfcheck-schedule
4+
5+
on:
6+
schedule:
7+
- cron: '0 0 * * 0'
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-22.04
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
persist-credentials: false
21+
22+
- name: ccache
23+
uses: hendrikmuhs/ccache-action@v1.2
24+
with:
25+
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
26+
27+
- name: Cache Cppcheck
28+
uses: actions/cache@v4
29+
with:
30+
path: cppcheck
31+
key: ${{ runner.os }}-selfcheck-schedule-cppcheck-${{ github.sha }}
32+
33+
- name: Install missing software on ubuntu
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install libboost-container-dev
37+
38+
- name: Self check (build)
39+
run: |
40+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
41+
# compile with verification and ast matchers
42+
make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXFLAGS="-g -O2 -w -DHAVE_BOOST" MATCHCOMPILER=yes VERIFY=1
43+
44+
selfcheck:
45+
needs: build
46+
47+
runs-on: ubuntu-22.04
48+
49+
strategy:
50+
matrix:
51+
project: ["cmake.output/compile_commands.json", "cppcheck.sln", "cppcheck.cppcheck", "gui/gui.cppcheck"]
52+
fail-fast: false
53+
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- name: Restore Cppcheck
58+
uses: actions/cache@v4
59+
with:
60+
path: cppcheck
61+
key: ${{ runner.os }}-selfcheck-schedule-cppcheck-${{ github.sha }}
62+
63+
- name: Install missing software on ubuntu
64+
if: contains(matrix.project, '.json')
65+
run: |
66+
sudo apt-get update
67+
sudo apt-get install qt6-base-dev libqt6charts6-dev qt6-tools-dev
68+
69+
- name: CMake
70+
if: contains(matrix.project, '.json')
71+
run: |
72+
cmake -S . -B cmake.output -Werror=dev -DCMAKE_BUILD_TYPE=Debug -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On
73+
74+
- name: Generate dependencies
75+
if: contains(matrix.project, '.json')
76+
run: |
77+
# make sure auto-generated GUI files exist
78+
make -C cmake.output autogen
79+
make -C cmake.output gui-build-deps triage-build-ui-deps
80+
81+
- name: Self check (${{ matrix.project }})
82+
run: |
83+
selfcheck_options="-j$(nproc) --std=c++11 --template=selfcheck --showtime=top5_summary -D__GNUC__ --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=gnu --inconclusive --enable=style,performance,portability,warning,missingInclude,internal --exception-handling --debug-warnings --check-level=exhaustive"
84+
cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2"
85+
more_options="-DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --library=qt"
86+
./cppcheck $selfcheck_options $cppcheck_options $more_options --project=${{ matrix.project }}

0 commit comments

Comments
 (0)