Skip to content

Commit 578e316

Browse files
firewaveglankk
andcommitted
added MinGW workflow
Co-authored-by: glankk <glankk@users.noreply.github.com>
1 parent fc24384 commit 578e316

1 file changed

Lines changed: 114 additions & 0 deletions

File tree

.github/workflows/CI-mingw.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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+
cache: false
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: make -j$(nproc) CXXOPTS="-Werror"
68+
69+
# gcc *and* clang are required to run-tests.py
70+
# install it at this point since it has gcc as dependency which might interfere with the build
71+
- name: install compiler (test)
72+
if: matrix.compiler == 'g++'
73+
run: |
74+
pacman -S --noconfirm clang
75+
76+
- name: install compiler (test)
77+
if: matrix.compiler == 'clang++'
78+
run: |
79+
pacman -S --noconfirm gcc
80+
81+
- name: make test
82+
run: make -j$(nproc) CXXOPTS="-Werror" test
83+
84+
- name: selfcheck
85+
run: |
86+
make -j$(nproc) selfcheck
87+
88+
- name: Run CMake
89+
run: |
90+
cmake -S . -B cmake.output -DCMAKE_COMPILE_WARNING_AS_ERROR=On
91+
92+
- name: CMake simplecpp
93+
run: |
94+
cmake --build cmake.output --target simplecpp -- -j $(nproc)
95+
96+
- name: CMake testrunner
97+
run: |
98+
cmake --build cmake.output --target testrunner -- -j $(nproc)
99+
100+
- name: Run testrunner
101+
run: |
102+
./cmake.output/testrunner
103+
104+
- name: Run with libstdc++ debug mode
105+
if: matrix.compiler == 'g++'
106+
run: |
107+
make clean
108+
make -j$(nproc) test selfcheck CXXOPTS="-Werror -g3 -D_GLIBCXX_DEBUG"
109+
110+
- name: Run with libc++ hardening mode
111+
if: matrix.compiler == 'clang++' && matrix.msystem == 'CLANG64'
112+
run: |
113+
make clean
114+
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)