Skip to content

Commit 5424e1f

Browse files
firewaveglankk
andcommitted
added MinGW workflow
Co-authored-by: glankk <glankk@users.noreply.github.com>
1 parent 00a131e commit 5424e1f

1 file changed

Lines changed: 118 additions & 0 deletions

File tree

.github/workflows/CI-mingw.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: CI-mingw
2+
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
7+
8+
defaults:
9+
run:
10+
shell: msys2 {0}
11+
12+
jobs:
13+
build:
14+
15+
strategy:
16+
matrix:
17+
compiler: [g++, clang++]
18+
# TODO: add MSYS after #556 is fixed
19+
msystem: [MINGW32, MINGW64, CLANG64]
20+
include:
21+
- msystem: MSYS
22+
pkg-prefix: ''
23+
- msystem: MINGW32
24+
pkg-prefix: 'mingw-w64-i686-'
25+
- msystem: MINGW64
26+
pkg-prefix: 'mingw-w64-x86_64-'
27+
- msystem: CLANG64
28+
pkg-prefix: 'mingw-w64-clang-x86_64-'
29+
- compiler: g++
30+
compiler-pkg: gcc
31+
- compiler: clang++
32+
compiler-pkg: clang
33+
exclude:
34+
- msystem: CLANG64
35+
compiler: g++
36+
fail-fast: false
37+
38+
runs-on: windows-2025
39+
40+
env:
41+
CXX: ${{ matrix.compiler }}
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
with:
46+
persist-credentials: false
47+
48+
- name: Set up MSYS2
49+
uses: msys2/setup-msys2@v2
50+
with:
51+
release: false # use pre-installed
52+
msystem: ${{ matrix.msystem }}
53+
# TODO: install mingw-w64-x86_64-make and use mingw32.make instead - currently fails with "Windows Subsystem for Linux has no installed distributions."
54+
# TODO: also run tests with non-prefixed Python?
55+
install: >-
56+
make
57+
${{ matrix.pkg-prefix }}cmake
58+
${{ matrix.pkg-prefix }}python
59+
${{ matrix.pkg-prefix }}python-pytest
60+
61+
- name: install compiler
62+
run: |
63+
pacman -S --noconfirm ${{ matrix.pkg-prefix }}${{ matrix.compiler-pkg }}
64+
${CXX} -v
65+
66+
- name: make simplecpp
67+
run: |
68+
make -j$(nproc) CXXOPTS="-Werror"
69+
70+
# gcc *and* clang are required to run-tests.py
71+
# install it at this point since it has gcc as dependency which might interfere with the build
72+
- name: install compiler (clang)
73+
if: matrix.compiler == 'g++'
74+
run: |
75+
pacman -S --noconfirm clang
76+
77+
- name: install compiler (gcc)
78+
if: matrix.compiler == 'clang++'
79+
run: |
80+
pacman -S --noconfirm gcc
81+
82+
- name: make test
83+
run: |
84+
# TODO: run tests with Windows paths
85+
make -j$(nproc) test
86+
87+
- name: selfcheck
88+
run: |
89+
# TODO: run tests with Windows paths
90+
make -j$(nproc) selfcheck
91+
92+
- name: Run CMake
93+
run: |
94+
cmake -S . -B cmake.output -DCMAKE_COMPILE_WARNING_AS_ERROR=On
95+
96+
- name: CMake simplecpp
97+
run: |
98+
cmake --build cmake.output --target simplecpp -- -j $(nproc)
99+
100+
- name: CMake testrunner
101+
run: |
102+
cmake --build cmake.output --target testrunner -- -j $(nproc)
103+
104+
- name: Run testrunner
105+
run: |
106+
./cmake.output/testrunner
107+
108+
- name: Run with libstdc++ debug mode
109+
if: matrix.compiler == 'g++'
110+
run: |
111+
make clean
112+
make -j$(nproc) test selfcheck CXXOPTS="-Werror -g3 -D_GLIBCXX_DEBUG"
113+
114+
- name: Run with libc++ hardening mode
115+
if: matrix.compiler == 'clang++' && matrix.msystem == 'CLANG64'
116+
run: |
117+
make clean
118+
make -j$(nproc) test selfcheck CXXOPTS="-Werror -stdlib=libc++ -g3 -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG" LDOPTS="-lc++"

0 commit comments

Comments
 (0)