Skip to content

Commit 6798a55

Browse files
authored
Fix #14223 (CI: Build windows release binary with mingw for comparisons) (#7909)
1 parent 495865d commit 6798a55

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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: release-windows-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+
# TODO: add CMake build
24+
build_mingw:
25+
strategy:
26+
matrix:
27+
# only use the latest windows-* as the installed toolchain is identical
28+
os: [windows-2025]
29+
fail-fast: false
30+
31+
runs-on: ${{ matrix.os }}
32+
33+
timeout-minutes: 19 # max + 3*std of the last 7K runs
34+
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
persist-credentials: false
39+
40+
- name: Set up MSYS2
41+
uses: msys2/setup-msys2@v2
42+
with:
43+
release: false # use pre-installed
44+
# TODO: install mingw-w64-x86_64-make and use mingw32.make instead - currently fails with "Windows Subsystem for Linux has no installed distributions."
45+
install: >-
46+
mingw-w64-x86_64-lld
47+
make
48+
mingw-w64-x86_64-gcc
49+
python
50+
51+
- name: Build cppcheck
52+
run: |
53+
export PATH="/mingw64/lib/ccache/bin:$PATH"
54+
# set RDYNAMIC to work around broken MinGW detection
55+
make VERBOSE=1 RDYNAMIC=-lshlwapi -j$(nproc) CXXFLAGS=-O2 MATCHCOMPILER=yes cppcheck
56+
57+
- name: Package
58+
run: |
59+
mkdir cppcheck-mingw
60+
cp cppcheck.exe cppcheck-mingw/
61+
cp -R cfg platforms cppcheck-mingw/
62+
cp /mingw64/bin/libgcc_s_seh-1.dll cppcheck-mingw/
63+
cp /mingw64/bin/libstdc*.dll cppcheck-mingw/
64+
cp /mingw64/bin/libwinpthread-1.dll cppcheck-mingw/
65+
66+
- uses: actions/upload-artifact@v4
67+
with:
68+
name: cppcheck-mingw
69+
path: cppcheck-mingw

0 commit comments

Comments
 (0)