-
Notifications
You must be signed in to change notification settings - Fork 726
331 lines (311 loc) · 11.7 KB
/
Copy pathbuild.yml
File metadata and controls
331 lines (311 loc) · 11.7 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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
---
# SPDX-License-Identifier: GPL-2.0-or-later
#
# This file is part of nvme.
# Copyright (c) 2026 SUSE LLC
#
# Authors: Daniel Wagner <dwagner@suse.de>
name: Build
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
nvme-cli:
runs-on: ubuntu-latest
strategy:
matrix:
distro: [debian, fedora, tumbleweed]
compiler: [gcc, clang]
buildtype: [debug, release]
container:
image: ghcr.io/linux-nvme/${{ matrix.distro }}:latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mark repo as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: build
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
if [ "${{ matrix.buildtype }}" = "release" ]; then
if [ "${{ matrix.distro }}" = "tumbleweed" ]; then
export CFLAGS="-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 \
-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables \
-fstack-clash-protection -Werror=return-type -flto=auto -g"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-flto=auto"
# TODO: The RH build depends on environment varibles/settings which prevent
# the compiler from working.
#
# elif [ "${{ matrix.distro }}" = "fedora" ]; then
# export CFLAGS="-O2 -flto=auto -ffat-lto-objects -fexceptions -g \
# -grecord-gcc-switches -pipe -Wall -Werror=format-security \
# -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS \
# -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong \
# -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic \
# -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables \
# -fstack-clash-protection"
# export CXXFLAGS="$CFLAGS"
# export LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,pack-relative-relocs \
# -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld \
# -specs=/usr/lib/rpm/redhat/redhat-hardened-ld-errors \
# -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 \
# -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes'
fi
fi
fi
scripts/build.sh -b ${{ matrix.buildtype }} -c ${{ matrix.compiler }} -x
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
name: upload logs
if: failure()
with:
name: logs files
path: |
.build-ci/meson-logs/*.txt
# Second test pass: the build matrix above runs the suite under valgrind,
# which skips the fork-based tests (e.g. the python multiprocessing registry
# test is skipIf(_under_valgrind)). Run the suite once more WITHOUT valgrind
# so those tests actually execute. fedora:latest tracks the newest Python,
# where interpreter-default changes (e.g. the 3.14 forkserver default that
# broke a fork-based test) surface before the other CI distros.
nvme-cli-no-valgrind:
name: nvme-cli unit tests without valgrind
runs-on: ubuntu-latest
container:
image: ghcr.io/linux-nvme/fedora:latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mark repo as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Report interpreter/toolchain versions
run: |
grep -E '^(NAME|VERSION)=' /etc/os-release
python3 --version
gcc --version | head -1
meson --version
- name: build
# No -x: scripts/build.sh runs plain "meson test" (default setup, no
# valgrind), so the fork-based tests valgrind skips actually run.
run: |
scripts/build.sh -b release -c gcc
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
name: upload logs
if: failure()
with:
name: no-valgrind logs files
path: |
.build-ci/meson-logs/*.txt
libnvme:
runs-on: ubuntu-latest
strategy:
matrix:
distro: [debian]
compiler: [gcc]
buildtype: [release]
container:
image: ghcr.io/linux-nvme/${{ matrix.distro }}:latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mark repo as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: build
run: |
scripts/build.sh -b ${{ matrix.buildtype }} -c ${{ matrix.compiler }} -x libnvme
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
name: upload logs
if: failure()
with:
name: libnvme logs files
path: |
.build-ci/meson-logs/*.txt
cross:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: armhf
- arch: s390x
- arch: ppc64le
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: enable foreign arch
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
- name: Login to GitHub Container Registry
uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: compile and run unit tests
run: |
docker run --rm \
--platform linux/amd64 \
-v "${{ github.workspace }}:/build" \
-w /build \
ghcr.io/linux-nvme/ubuntu-cross-${{ matrix.arch }}:latest \
sh -c "git config --global --add safe.directory /build && scripts/build.sh -b release -c gcc -t ${{ matrix.arch }} cross"
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
name: upload logs
if: failure()
with:
name: log files
path: |
.build-ci/meson-logs/*.txt
fallback-shared-libraries:
name: fallback shared libraries
runs-on: ubuntu-latest
container:
image: ghcr.io/linux-nvme/debian:latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mark repo as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: build
run: |
scripts/build.sh -b release -c gcc fallback
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: failure()
with:
name: log files
path: |
.build-ci/meson-logs/*.txt
build-muon:
name: muon minimal static
runs-on: ubuntu-latest
container:
image: ghcr.io/linux-nvme/debian:latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mark repo as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: build
run: |
scripts/build.sh -m muon
build-make-static:
name: make static
runs-on: ubuntu-latest
container:
image: ghcr.io/linux-nvme/debian:latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mark repo as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: build
run: |
make static
build-musl:
name: musl libc build on Debian
runs-on: ubuntu-latest
container:
image: ghcr.io/linux-nvme/debian:latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mark repo as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: build
run: |
CC=musl-gcc scripts/build.sh musl
build-musl-minimal-static:
name: musl libc minimal static build on Debian
runs-on: ubuntu-latest
container:
image: ghcr.io/linux-nvme/debian:latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mark repo as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: build
run: |
scripts/build.sh minimal_static
build-nofabrics:
name: no-fabrics build with unit tests
runs-on: ubuntu-latest
container:
image: ghcr.io/linux-nvme/debian:latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mark repo as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: build
run: |
scripts/build.sh nofabrics
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
name: upload logs
if: failure()
with:
name: no-fabrics log files
path: |
.build-ci/meson-logs/*.txt
build-alpine:
name: musl libc build on Alpine
runs-on: ubuntu-latest
container:
image: ghcr.io/linux-nvme/alpine:latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mark repo as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: build
run: |
scripts/build.sh musl
build-distro:
name: build libnvme and nvme-cli separately
runs-on: ubuntu-latest
container:
image: ghcr.io/linux-nvme/debian:latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mark repo as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: build
run: |
scripts/build.sh distro
build-liburing:
name: build with liburing support enabled
runs-on: ubuntu-latest
container:
image: ghcr.io/linux-nvme/debian:latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Mark repo as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: build
run: |
scripts/build.sh liburing
windows-msys2-ucrt64:
runs-on: windows-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0
with:
msystem: UCRT64
update: true
install: >-
git
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-pkgconf
mingw-w64-ucrt-x86_64-meson
mingw-w64-ucrt-x86_64-ninja
mingw-w64-ucrt-x86_64-ccache
mingw-w64-ucrt-x86_64-json-c
mingw-w64-ucrt-x86_64-python-jsonschema
- name: Build nvme-cli
shell: msys2 {0}
run: |
set -euxo pipefail
which bash
bash --version
which git
git --version
git config --global --add safe.directory "$GITHUB_WORKSPACE"
scripts/build.sh -b release -c /ucrt64/bin/gcc
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: failure()
with:
name: windows-msys2-ucrt64-logs
path: |
.build-ci/meson-logs/*.txt