Skip to content

Commit dc91e79

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

1 file changed

Lines changed: 90 additions & 0 deletions

File tree

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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) CXXOPTS="-Werror -g -O2" CPPOPTS="-DCHECK_INTERNAL -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+
with:
57+
persist-credentials: false
58+
59+
- name: Restore Cppcheck
60+
uses: actions/cache@v4
61+
with:
62+
path: cppcheck
63+
key: ${{ runner.os }}-selfcheck-schedule-cppcheck-${{ github.sha }}
64+
65+
- name: Install missing software on ubuntu
66+
if: contains(matrix.project, '.json')
67+
run: |
68+
sudo apt-get update
69+
sudo apt-get install qt6-base-dev libqt6charts6-dev qt6-tools-dev
70+
71+
# TODO: enable dmake
72+
- name: CMake
73+
if: contains(matrix.project, '.json')
74+
run: |
75+
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
76+
77+
- name: Generate dependencies
78+
if: contains(matrix.project, '.json')
79+
run: |
80+
# make sure auto-generated GUI files exist
81+
make -C cmake.output autogen
82+
make -C cmake.output gui-build-deps triage-build-ui-deps
83+
84+
# TODO: generate Visual Studio project
85+
86+
- name: Self check (${{ matrix.project }})
87+
run: |
88+
selfcheck_options="-j$(nproc) --std=c++11 --template=selfcheck --showtime=file-total --error-exitcode=1 --inline-suppr --suppressions-list=.selfcheck_suppressions --inconclusive --enable=style,performance,portability,warning,missingInclude,internal,information --exception-handling --debug-warnings --check-level=exhaustive"
89+
# TODO: add libraries for Visual Studio project
90+
./cppcheck $selfcheck_options --project=${{ matrix.project }}

0 commit comments

Comments
 (0)