Skip to content

Commit 0fbcc04

Browse files
committed
added MinGW workflow
1 parent 47e5e4e commit 0fbcc04

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed

.github/workflows/CI-mingw.yml

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