Skip to content

Commit 54a868a

Browse files
firewaveglankk
andcommitted
added MinGW workflow
Co-authored-by: glankk <[email protected]>
1 parent bdf86e0 commit 54a868a

File tree

1 file changed

+113
-0
lines changed

1 file changed

+113
-0
lines changed

.github/workflows/CI-mingw.yml

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