forked from danmar/cppcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (113 loc) · 4.75 KB
/
CI-unixish.yml
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
name: CI-unixish
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
fail-fast: false # not worthwhile...
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install missing software on ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install libxml2-utils
sudo apt-get install z3 libz3-dev
cp externals/z3_version_old.h externals/z3_version.h
- name: Install missing software on macos
if: matrix.os == 'macos-latest'
run: |
brew install coreutils z3
- name: Install Qt
if: matrix.os == 'ubuntu-latest'
uses: jurplel/install-qt-action@v2
with:
modules: 'qtcharts'
- name: Test CMake build
run: |
mkdir cmake.output
cd cmake.output
cmake -G "Unix Makefiles" -DBUILD_TESTS=On ..
make -j$(nproc) check
cd ..
- name: Build and test with Unsigned char
run: |
make clean
make -j$(nproc) CXXFLAGS=-funsigned-char testrunner
./testrunner TestSymbolDatabase
- name: Build cppcheck
run: |
make clean
cp externals/z3_version_old.h externals/z3_version.h
make -j$(nproc) USE_Z3=yes HAVE_RULES=yes
- name: Build test
run: |
make -j$(nproc) testrunner USE_Z3=yes HAVE_RULES=yes
- name: Run test
run: |
make -j$(nproc) check USE_Z3=yes HAVE_RULES=yes
- name: Validate
run: |
make -j$(nproc) validateCFG validatePlatforms
- name: Test addons
run: |
./cppcheck --addon=threadsafety addons/test/threadsafety
./cppcheck --addon=threadsafety --std=c++03 addons/test/threadsafety
- name: Build GUI on ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
pushd gui
qmake HAVE_QCHART=yes
make -j$(nproc)
- name: Run GUI tests on ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
pushd gui/test/projectfile
qmake
make -j$(nproc)
./test-projectfile
- name: Generate Qt help file on ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
pushd gui/help
qhelpgenerator online-help.qhcp -o online-help.qhc
# Run self check after "Build GUI" to include generated headers in analysis
- name: Self check
if: matrix.os == 'ubuntu-latest'
run: |
# compile with verification and ast matchers
make clean
make -j$(nproc) -s CPPFLAGS="-DCHECK_INTERNAL" CXXFLAGS="-g -O2" MATCHCOMPILER=yes VERIFY=1
# self check lib/cli
mkdir b1
./cppcheck -q -j$(nproc) --template=gcc --cppcheck-build-dir=b1 -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib --addon=naming.json -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli --inconclusive --enable=style,performance,portability,warning,internal --exception-handling cli lib
# check gui with qt settings
mkdir b2
./cppcheck -q -j$(nproc) --template=gcc --cppcheck-build-dir=b2 -D__CPPCHECK__ -DQT_VERSION=0x050000 --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=qt --addon=naming.json -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ --enable=style,performance,portability,warning,internal --exception-handling gui/*.cpp
# self check test and tools
./cppcheck -q -j$(nproc) --template=gcc -D__CPPCHECK__ --error-exitcode=1 --inline-suppr --suppressions-list=.travis_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ -Icli -Igui --inconclusive --enable=style,performance,portability,warning,internal --exception-handling test/*.cpp tools
- name: Build triage on ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
pushd tools/triage
qmake
make -j$(nproc)
- name: Build Fuzzer
run: |
g++ -fsyntax-only -std=c++11 -Ilib oss-fuzz/*.cpp
- uses: actions/upload-artifact@v2
with:
name: cppcheck_cli
path: ./cppcheck
- uses: actions/upload-artifact@v2
with:
name: cppcheck_cli
path: ./**/cfg/*.cfg
- uses: actions/upload-artifact@v2
with:
name: cppcheck_cli
path: ./**/platforms/*.xml