Skip to content

Commit 97e5da6

Browse files
committed
Revert "release-windows.yml: fixed collecting files [skip ci] (cppcheck-opensource#6904)"
This reverts commit d23c88d.
1 parent 6650bce commit 97e5da6

21 files changed

Lines changed: 2650 additions & 3 deletions

.github/workflows/CI-cygwin.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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: CI-cygwin
4+
5+
on:
6+
push:
7+
branches:
8+
- 'main'
9+
- 'releases/**'
10+
- '2.*'
11+
tags:
12+
- '2.*'
13+
pull_request:
14+
15+
permissions:
16+
contents: read
17+
18+
defaults:
19+
run:
20+
shell: cmd
21+
22+
jobs:
23+
build_cygwin:
24+
strategy:
25+
matrix:
26+
os: [windows-2022]
27+
arch: [x64]
28+
include:
29+
- platform: 'x86_64'
30+
packages: |
31+
gcc-g++
32+
python3
33+
fail-fast: false
34+
35+
runs-on: ${{ matrix.os }}
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- name: Set up Cygwin
41+
uses: cygwin/cygwin-install-action@master
42+
with:
43+
platform: ${{ matrix.arch }}
44+
packages: ${{ matrix.packages }}
45+
46+
# Cygwin will always link the binaries even if they already exist. The linking is also extremely slow. So just run the "check" target which includes all the binaries.
47+
- name: Build all and run test
48+
run: |
49+
C:\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make VERBOSE=1 -j2 check
50+
51+
- name: Extra test for misra
52+
run: |
53+
cd %GITHUB_WORKSPACE%\addons\test
54+
..\..\cppcheck.exe --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64
55+
python3 ..\misra.py -verify misra\misra-test.c.dump
56+
..\..\cppcheck.exe --addon=misra --enable=style --inline-suppr --enable=information --error-exitcode=1 misra\misra-ctu-1-test.c misra\misra-ctu-2-test.c
57+

.github/workflows/CI-mingw.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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: CI-mingw
4+
5+
on:
6+
push:
7+
branches:
8+
- 'main'
9+
- 'releases/**'
10+
- '2.*'
11+
tags:
12+
- '2.*'
13+
pull_request:
14+
15+
permissions:
16+
contents: read
17+
18+
defaults:
19+
run:
20+
shell: msys2 {0}
21+
22+
jobs:
23+
build_mingw:
24+
strategy:
25+
matrix:
26+
# the MinGW installation in windows-2019 is supposed to be 8.1 but it is 12.2
27+
# the MinGW installation in windows-2022 is not including all necessary packages by default, so just use the older image instead - package versions are he same
28+
os: [windows-2019]
29+
fail-fast: false
30+
31+
runs-on: ${{ matrix.os }}
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- name: Set up MSYS2
37+
uses: msys2/setup-msys2@v2
38+
with:
39+
release: false # use pre-installed
40+
install: >-
41+
mingw-w64-x86_64-lld
42+
mingw-w64-x86_64-ccache
43+
44+
- name: ccache
45+
uses: hendrikmuhs/ccache-action@v1.2
46+
with:
47+
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
48+
49+
# TODO: bail out on warning
50+
- name: Build cppcheck
51+
run: |
52+
export PATH="/mingw64/lib/ccache/bin:$PATH"
53+
# set RDYNAMIC to work around broken MinGW detection
54+
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 cppcheck
55+
env:
56+
LDFLAGS: -fuse-ld=lld # use lld for faster linking
57+
58+
- name: Build test
59+
run: |
60+
export PATH="/mingw64/lib/ccache/bin:$PATH"
61+
# set RDYNAMIC to work around broken MinGW detection
62+
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 testrunner
63+
env:
64+
LDFLAGS: -fuse-ld=lld # use lld for faster linking
65+
66+
- name: Run test
67+
run: |
68+
export PATH="/mingw64/lib/ccache/bin:$PATH"
69+
# set RDYNAMIC to work around broken MinGW detection
70+
make VERBOSE=1 RDYNAMIC=-lshlwapi -j2 check
71+
env:
72+
LDFLAGS: -fuse-ld=lld # use lld for faster linking
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
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: CI-unixish-docker
4+
5+
on:
6+
push:
7+
branches:
8+
- 'main'
9+
- 'releases/**'
10+
- '2.*'
11+
tags:
12+
- '2.*'
13+
pull_request:
14+
15+
permissions:
16+
contents: read
17+
18+
env:
19+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
20+
21+
jobs:
22+
build_cmake:
23+
24+
strategy:
25+
matrix:
26+
image: ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:24.04", "ubuntu:24.10"]
27+
include:
28+
- build_gui: false
29+
- image: "ubuntu:24.04"
30+
build_gui: true
31+
- image: "ubuntu:24.10"
32+
build_gui: true
33+
fail-fast: false # Prefer quick result
34+
35+
runs-on: ubuntu-22.04
36+
37+
# TODO: is this actually applied to the guest?
38+
env:
39+
# TODO: figure out why there are cache misses with PCH enabled
40+
CCACHE_SLOPPINESS: pch_defines,time_macros
41+
42+
container:
43+
image: ${{ matrix.image }}
44+
45+
steps:
46+
# we need to stay at v3 for now because Node 20 does not support the older distros
47+
# /__e/node20/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /__e/node20/bin/node)
48+
- uses: actions/checkout@v3
49+
if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04'
50+
51+
- uses: actions/checkout@v4
52+
if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04'
53+
54+
- name: Install missing software on ubuntu
55+
if: contains(matrix.image, 'ubuntu')
56+
run: |
57+
apt-get update
58+
apt-get install -y cmake g++ make libxml2-utils libpcre3-dev
59+
60+
- name: Install missing software (gui) on latest ubuntu
61+
if: matrix.build_gui
62+
run: |
63+
apt-get install -y qt6-base-dev qt6-charts-dev qt6-tools-dev
64+
65+
# needs to be called after the package installation since
66+
# - it doesn't call "apt-get update"
67+
#
68+
# needs to be to fixated on 1.2.11 so it works with older images - see https://github.com/hendrikmuhs/ccache-action/issues/178.
69+
# using the older version will cause a two minute hang in its post-run step.
70+
- name: ccache
71+
uses: hendrikmuhs/ccache-action@v1.2.11
72+
if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04'
73+
with:
74+
key: ${{ github.workflow }}-${{ matrix.image }}
75+
76+
# needs to be called after the package installation since
77+
# - it doesn't call "apt-get update"
78+
- name: ccache
79+
uses: hendrikmuhs/ccache-action@v1.2
80+
if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04'
81+
with:
82+
key: ${{ github.workflow }}-${{ matrix.image }}
83+
84+
# tests require CMake 3.9 - ccache available
85+
- name: CMake build (no tests)
86+
if: matrix.image == 'ubuntu:16.04'
87+
run: |
88+
mkdir cmake.output
89+
cd cmake.output
90+
cmake -G "Unix Makefiles" -DHAVE_RULES=On -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
91+
cmake --build . -- -j$(nproc)
92+
93+
- name: CMake build
94+
if: ${{ !matrix.build_gui && matrix.image != 'ubuntu:16.04' }}
95+
run: |
96+
mkdir cmake.output
97+
cd cmake.output
98+
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 ..
99+
cmake --build . -- -j$(nproc)
100+
101+
- name: CMake build (with GUI)
102+
if: matrix.build_gui
103+
run: |
104+
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
105+
cmake --build cmake.output -- -j$(nproc)
106+
107+
- name: Run CMake test
108+
if: matrix.image != 'ubuntu:16.04'
109+
run: |
110+
cmake --build cmake.output --target check -- -j$(nproc)
111+
112+
build_make:
113+
114+
strategy:
115+
matrix:
116+
image: ["ubuntu:16.04", "ubuntu:18.04", "ubuntu:24.04", "ubuntu:24.10"]
117+
fail-fast: false # Prefer quick result
118+
119+
runs-on: ubuntu-22.04
120+
121+
container:
122+
image: ${{ matrix.image }}
123+
124+
steps:
125+
# we need to stay at v3 for now because Node 20 does not support the older distros
126+
# /__e/node20/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /__e/node20/bin/node)
127+
- uses: actions/checkout@v3
128+
if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04'
129+
130+
- uses: actions/checkout@v4
131+
if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04'
132+
133+
- name: Install missing software on ubuntu
134+
if: contains(matrix.image, 'ubuntu')
135+
run: |
136+
apt-get update
137+
apt-get install -y g++ make python3 libxml2-utils libpcre3-dev
138+
139+
# needs to be called after the package installation since
140+
# - it doesn't call "apt-get update"
141+
#
142+
# needs to be to fixated on 1.2.11 so it works with older images - see https://github.com/hendrikmuhs/ccache-action/issues/178.
143+
# using the older version will cause a two minute hang in its post-run step.
144+
- name: ccache
145+
uses: hendrikmuhs/ccache-action@v1.2.11
146+
if: matrix.image == 'ubuntu:16.04' || matrix.image == 'ubuntu:18.04'
147+
with:
148+
key: ${{ github.workflow }}-${{ matrix.image }}
149+
150+
# needs to be called after the package installation since
151+
# - it doesn't call "apt-get update"
152+
- name: ccache
153+
uses: hendrikmuhs/ccache-action@v1.2
154+
if: matrix.image != 'ubuntu:16.04' && matrix.image != 'ubuntu:18.04'
155+
with:
156+
key: ${{ github.workflow }}-${{ matrix.image }}
157+
158+
- name: Build cppcheck
159+
run: |
160+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
161+
make -j$(nproc) HAVE_RULES=yes CXXFLAGS="-w"
162+
163+
- name: Build test
164+
run: |
165+
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
166+
make -j$(nproc) testrunner HAVE_RULES=yes CXXFLAGS="-w"
167+
168+
- name: Run test
169+
run: |
170+
make -j$(nproc) check HAVE_RULES=yes
171+
172+
# requires python3
173+
- name: Run extra tests
174+
run: |
175+
tools/generate_and_run_more_tests.sh
176+
177+
# requires which
178+
- name: Validate
179+
run: |
180+
make -j$(nproc) checkCWEEntries validateXML
181+
182+
- name: Test addons
183+
run: |
184+
./cppcheck --addon=threadsafety addons/test/threadsafety
185+
./cppcheck --addon=threadsafety --std=c++03 addons/test/threadsafety
186+
187+
- name: Generate Qt help file on ubuntu 18.04
188+
if: false # matrix.os == 'ubuntu-18.04'
189+
run: |
190+
pushd gui/help
191+
qcollectiongenerator online-help.qhcp -o online-help.qhc
192+

0 commit comments

Comments
 (0)