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