Skip to content

Commit 49a8f16

Browse files
committed
added scheduled self-checks with all available project imports to CI
1 parent 747862f commit 49a8f16

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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+
20+
- name: ccache
21+
uses: hendrikmuhs/ccache-action@v1.2.11
22+
with:
23+
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
24+
25+
- name: Cache Cppcheck
26+
uses: actions/cache@v4
27+
with:
28+
path: cppcheck
29+
key: ${{ runner.os }}-selfcheck-schedule-cppcheck-${{ github.sha }}
30+
31+
- name: Install missing software on ubuntu
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install libboost-container-dev
35+
36+
- name: Self check (build)
37+
run: |
38+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
39+
# compile with verification and ast matchers
40+
make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXFLAGS="-g -O2 -w -DHAVE_BOOST" MATCHCOMPILER=yes VERIFY=1
41+
42+
selfcheck:
43+
needs: build
44+
45+
runs-on: ubuntu-22.04
46+
47+
strategy:
48+
matrix:
49+
project: ["cmake.output/compile_commands.json", "cppcheck.sln", "cppcheck.cppcheck", "gui/gui.cppcheck"]
50+
fail-fast: false
51+
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Restore Cppcheck
56+
uses: actions/cache@v4
57+
with:
58+
path: cppcheck
59+
key: ${{ runner.os }}-selfcheck-schedule-cppcheck-${{ github.sha }}
60+
61+
- name: Install missing software on ubuntu
62+
if: contains(matrix.project, '.json')
63+
run: |
64+
sudo apt-get update
65+
sudo apt-get install qtbase5-dev qttools5-dev libqt5charts5-dev
66+
67+
# TODO: update to Qt6
68+
- name: CMake
69+
if: contains(matrix.project, '.json')
70+
run: |
71+
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=Debug -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DWITH_QCHART=On -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On
72+
73+
- name: Generate dependencies
74+
if: contains(matrix.project, '.json')
75+
run: |
76+
# make sure auto-generated GUI files exist
77+
make -C cmake.output autogen
78+
make -C cmake.output gui-build-deps triage-build-ui-deps
79+
80+
- name: Self check (${{ matrix.project }})
81+
run: |
82+
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"
83+
cppcheck_options="-D__CPPCHECK__ -DCHECK_INTERNAL -DHAVE_RULES --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2"
84+
more_options="-DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 -DQT_CHARTS_LIB --library=qt"
85+
./cppcheck $selfcheck_options $cppcheck_options $more_options --project=${{ matrix.project }}

0 commit comments

Comments
 (0)