forked from danmar/cppcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (63 loc) · 2.13 KB
/
CI-unixish-docker.yml
File metadata and controls
79 lines (63 loc) · 2.13 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# 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-docker
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
image: ["centos:7", "ubuntu:14.04", "ubuntu:16.04", "ubuntu:21.10"]
fail-fast: false # Prefer quick result
runs-on: ubuntu-20.04
container:
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v2
- name: Install missing software on CentOS 7
if: matrix.image == 'centos:7'
run: |
yum install -y cmake gcc-c++ make
yum install -y pcre-devel
- name: Install missing software on ubuntu
if: matrix.image != 'centos:7'
run: |
apt-get update
apt-get install -y cmake g++ make python libxml2-utils
apt-get install -y libpcre3-dev
# tests require CMake 3.4
- name: Test CMake build (no tests)
if: matrix.image != 'ubuntu:21.10'
run: |
mkdir cmake.output
cd cmake.output
cmake -G "Unix Makefiles" -DHAVE_RULES=On ..
make -j$(nproc)
cd ..
- name: Test CMake build
if: matrix.image == 'ubuntu:21.10'
run: |
mkdir cmake.output
cd cmake.output
cmake -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On ..
make -j$(nproc) check
cd ..
- name: Build cppcheck
run: |
make clean
make -j$(nproc) HAVE_RULES=yes
- name: Build test
run: |
make -j$(nproc) testrunner HAVE_RULES=yes
- name: Run test
run: |
make -j$(nproc) check HAVE_RULES=yes
- name: Run extra tests
run: |
tools/generate_and_run_more_tests.sh
- name: Validate
run: |
make -j$(nproc) checkCWEEntries validateXML
- name: Test addons
run: |
./cppcheck --addon=threadsafety addons/test/threadsafety
./cppcheck --addon=threadsafety --std=c++03 addons/test/threadsafety