-
Notifications
You must be signed in to change notification settings - Fork 1.5k
185 lines (151 loc) · 6.45 KB
/
CI-unixish-docker.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# 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:
branches:
- 'main'
- 'releases/**'
tags:
- '2.*'
pull_request:
permissions:
contents: read
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
jobs:
build_cmake:
strategy:
matrix:
image: ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:24.04"]
include:
- build_gui: false
- image: "ubuntu:24.04"
build_gui: true
fail-fast: false # Prefer quick result
runs-on: ubuntu-22.04
# TODO: is this actually applied to the guest?
env:
# TODO: figure out why there are cache misses with PCH enabled
CCACHE_SLOPPINESS: pch_defines,time_macros
container:
image: ${{ matrix.image }}
steps:
# we need to stay at v3 for now because Node 20 does not support the older distros
# /__e/node20/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /__e/node20/bin/node)
- uses: actions/checkout@v4
- name: Install missing software on ubuntu
if: contains(matrix.image, 'ubuntu')
run: |
apt-get update
apt-get install -y cmake g++ make libxml2-utils libpcre3-dev
- name: Install missing software (gui) on latest ubuntu
if: matrix.build_gui
run: |
apt-get install -y qt6-base-dev qt6-charts-dev qt6-tools-dev
# needs to be called after the package installation since
# - it doesn't call "apt-get update"
#
# needs to be to fixated on 1.2.11 so it works with older images - see https://github.com/hendrikmuhs/ccache-action/issues/178.
# using the older version will cause a two minute hang in its post-run step.
- name: ccache
uses: hendrikmuhs/[email protected]
if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04'
with:
key: ${{ github.workflow }}-${{ matrix.image }}
# needs to be called after the package installation since
# - it doesn't call "apt-get update"
- name: ccache
uses: hendrikmuhs/[email protected]
if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04'
with:
key: ${{ github.workflow }}-${{ matrix.image }}
# tests require CMake 3.9 - ccache available
- name: CMake build (no tests)
if: matrix.image == 'ubuntu:16.04'
run: |
mkdir cmake.output
cd cmake.output
cmake -G "Unix Makefiles" -DHAVE_RULES=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
cmake --build . -- -j$(nproc)
- name: CMake build
if: ${{ !matrix.build_gui && matrix.image != 'ubuntu:16.04' }}
run: |
mkdir cmake.output
cd cmake.output
cmake -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
cmake --build . -- -j$(nproc)
- name: CMake build (with GUI)
if: matrix.build_gui
run: |
cmake -S . -B cmake.output -G "Unix Makefiles" -DHAVE_RULES=On -DBUILD_TESTS=On -DBUILD_GUI=On -DUSE_QT6=On -DWITH_QCHART=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build cmake.output -- -j$(nproc)
- name: Run CMake test
if: matrix.image != 'ubuntu:16.04'
run: |
cmake --build cmake.output --target check -- -j$(nproc)
build_make:
strategy:
matrix:
image: ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:24.04"]
fail-fast: false # Prefer quick result
runs-on: ubuntu-22.04
container:
image: ${{ matrix.image }}
steps:
# we need to stay at v3 for now because Node 20 does not support the older distros
# /__e/node20/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /__e/node20/bin/node)
- uses: actions/checkout@v3
if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04'
- uses: actions/checkout@v4
if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04'
- name: Install missing software on ubuntu
if: contains(matrix.image, 'ubuntu')
run: |
apt-get update
apt-get install -y g++ make python3 libxml2-utils libpcre3-dev
# needs to be called after the package installation since
# - it doesn't call "apt-get update"
#
# needs to be to fixated on 1.2.11 so it works with older images - see https://github.com/hendrikmuhs/ccache-action/issues/178.
# using the older version will cause a two minute hang in its post-run step.
- name: ccache
uses: hendrikmuhs/[email protected]
if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04'
with:
key: ${{ github.workflow }}-${{ matrix.image }}
# needs to be called after the package installation since
# - it doesn't call "apt-get update"
- name: ccache
uses: hendrikmuhs/[email protected]
if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04'
with:
key: ${{ github.workflow }}-${{ matrix.image }}
- name: Build cppcheck
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make -j$(nproc) HAVE_RULES=yes CXXFLAGS="-w"
- name: Build test
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
make -j$(nproc) testrunner HAVE_RULES=yes CXXFLAGS="-w"
- name: Run test
run: |
make -j$(nproc) check HAVE_RULES=yes
# requires python3
- name: Run extra tests
run: |
tools/generate_and_run_more_tests.sh
# requires which
- 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
- name: Generate Qt help file on ubuntu 18.04
if: false # matrix.os == 'ubuntu-18.04'
run: |
pushd gui/help
qcollectiongenerator online-help.qhcp -o online-help.qhc