-
Notifications
You must be signed in to change notification settings - Fork 0
236 lines (213 loc) · 7.69 KB
/
Copy pathci.yml
File metadata and controls
236 lines (213 loc) · 7.69 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
name: CI
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
# The plugin library is checked in every link shape on each platform. stdcorelib is built and
# installed first because this repository intentionally consumes its installed CMake package.
build:
name: ${{ matrix.platform }} ${{ matrix.config }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
platform: [ linux-gcc, linux-clang, macos, windows-msvc, windows-clang-cl ]
config: [ shared, static, release ]
include:
- platform: linux-gcc
os: ubuntu-latest
cxx: g++
- platform: linux-clang
os: ubuntu-latest
cxx: clang++
- platform: macos
os: macos-latest
cxx: clang++
- platform: windows-msvc
os: windows-latest
cxx: cl
- platform: windows-clang-cl
os: windows-latest
cxx: clang-cl
steps:
- uses: actions/checkout@v4
# The plugin currently depends on changes developed on stdcorelib's dev branch. Promote
# both repositories together when those changes land on main.
- name: Check out stdcorelib
uses: actions/checkout@v4
with:
repository: stdware/stdcorelib
ref: dev
path: _deps/stdcorelib
- uses: ./.github/actions/setup
- name: Settings for this configuration
id: cfg
shell: bash
run: |
case "${{ matrix.config }}" in
shared) flags="-DSTDC_PLUGIN_BUILD_SHARED=ON"; type=Debug ;;
static) flags="-DSTDC_PLUGIN_BUILD_STATIC=ON"; type=Debug ;;
release) flags="-DSTDC_PLUGIN_BUILD_SHARED=ON"; type=Release ;;
esac
echo "flags=$flags" >> "$GITHUB_OUTPUT"
echo "type=$type" >> "$GITHUB_OUTPUT"
- name: Build and install stdcorelib
shell: bash
env:
CXX: ${{ matrix.cxx }}
run: |
cmake -G Ninja -S _deps/stdcorelib -B _deps/stdcorelib-build \
-DCMAKE_BUILD_TYPE=${{ steps.cfg.outputs.type }} \
-DSTDC_BUILD_SHARED=ON \
-DSTDC_INSTALL=ON \
-DCMAKE_INSTALL_PREFIX="$RUNNER_TEMP/stdcorelib"
cmake --build _deps/stdcorelib-build
cmake --install _deps/stdcorelib-build
- name: Configure
shell: bash
env:
CXX: ${{ matrix.cxx }}
run: |
cmake -G Ninja -S . -B build \
-DCMAKE_BUILD_TYPE=${{ steps.cfg.outputs.type }} \
-Dstdcorelib_DIR="$RUNNER_TEMP/stdcorelib/lib/cmake/stdcorelib" \
-DSTDC_PLUGIN_BUILD_TESTS=ON \
${{ steps.cfg.outputs.flags }}
- name: Build
run: cmake --build build
- name: Test
shell: bash
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
export PATH="$(cygpath -u "$RUNNER_TEMP")/stdcorelib/bin:$PATH"
fi
ctest --test-dir build --output-on-failure --no-tests=error
- name: Install
run: cmake --install build --prefix "${{ runner.temp }}/stdcorelib-plugin"
# The compiler flag is private to each library target, so tests remain ordinary consumers of
# two libraries built without exception support. clang-cl stays in the matrix because it
# rejects throw expressions under /EHs-c-, unlike cl, which accepts them but disables unwind.
no-exceptions:
name: ${{ matrix.platform }} no-exceptions
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
platform: [ linux-gcc, macos, windows-msvc, windows-clang-cl ]
include:
- platform: linux-gcc
os: ubuntu-latest
cxx: g++
- platform: macos
os: macos-latest
cxx: clang++
- platform: windows-msvc
os: windows-latest
cxx: cl
- platform: windows-clang-cl
os: windows-latest
cxx: clang-cl
steps:
- uses: actions/checkout@v4
- name: Check out stdcorelib
uses: actions/checkout@v4
with:
repository: stdware/stdcorelib
ref: dev
path: _deps/stdcorelib
- uses: ./.github/actions/setup
- name: Build and install stdcorelib without exceptions
shell: bash
env:
CXX: ${{ matrix.cxx }}
run: |
cmake -G Ninja -S _deps/stdcorelib -B _deps/stdcorelib-build \
-DCMAKE_BUILD_TYPE=Debug \
-DSTDC_BUILD_SHARED=ON \
-DSTDC_ENABLE_EXCEPTIONS=OFF \
-DSTDC_INSTALL=ON \
-DCMAKE_INSTALL_PREFIX="$RUNNER_TEMP/stdcorelib"
cmake --build _deps/stdcorelib-build
cmake --install _deps/stdcorelib-build
- name: Configure
shell: bash
env:
CXX: ${{ matrix.cxx }}
run: |
cmake -G Ninja -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-Dstdcorelib_DIR="$RUNNER_TEMP/stdcorelib/lib/cmake/stdcorelib" \
-DSTDC_PLUGIN_BUILD_SHARED=ON \
-DSTDC_PLUGIN_BUILD_TESTS=ON \
-DSTDC_PLUGIN_ENABLE_EXCEPTIONS=OFF
- name: Build
run: cmake --build build
- name: Test
shell: bash
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
export PATH="$(cygpath -u "$RUNNER_TEMP")/stdcorelib/bin:$PATH"
fi
ctest --test-dir build --output-on-failure --no-tests=error
# The Windows implementation against the GNU Windows headers and linker. This is separate
# from clang-cl: both emit PE files, but expose different compatibility edges. The
# no-exceptions shape covers the combination of those Windows paths and GCC's -fno-exceptions.
mingw:
name: windows-mingw ${{ matrix.config }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
config: [ shared, static, no-exceptions ]
steps:
- uses: actions/checkout@v4
- name: Check out stdcorelib
uses: actions/checkout@v4
with:
repository: stdware/stdcorelib
ref: dev
path: _deps/stdcorelib
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: false
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-boost
- name: Build and install stdcorelib
shell: msys2 {0}
run: |
flags=
if [[ "${{ matrix.config }}" == "no-exceptions" ]]; then
flags="-DSTDC_ENABLE_EXCEPTIONS=OFF"
fi
cmake -G Ninja -S _deps/stdcorelib -B _deps/stdcorelib-build \
-DCMAKE_BUILD_TYPE=Debug \
-DSTDC_BUILD_SHARED=ON \
-DSTDC_INSTALL=ON \
-DCMAKE_INSTALL_PREFIX="$RUNNER_TEMP/stdcorelib" \
$flags
cmake --build _deps/stdcorelib-build
cmake --install _deps/stdcorelib-build
- name: Build
shell: msys2 {0}
run: |
case "${{ matrix.config }}" in
shared) flags="-DSTDC_PLUGIN_BUILD_SHARED=ON" ;;
static) flags="-DSTDC_PLUGIN_BUILD_STATIC=ON" ;;
no-exceptions) flags="-DSTDC_PLUGIN_BUILD_SHARED=ON -DSTDC_PLUGIN_ENABLE_EXCEPTIONS=OFF" ;;
esac
cmake -G Ninja -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-Dstdcorelib_DIR="$RUNNER_TEMP/stdcorelib/lib/cmake/stdcorelib" \
-DSTDC_PLUGIN_BUILD_TESTS=ON \
$flags
cmake --build build
- name: Test
shell: msys2 {0}
run: |
export PATH="$(cygpath -u "$RUNNER_TEMP")/stdcorelib/bin:$PATH"
ctest --test-dir build --output-on-failure --no-tests=error