-
Notifications
You must be signed in to change notification settings - Fork 710
263 lines (246 loc) · 9.08 KB
/
build.yml
File metadata and controls
263 lines (246 loc) · 9.08 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
---
# SPDX-License-Identifier: GPL-2.0-or-later
#
# This file is part of nvme.
# Copyright (c) 2026 SUSE LLC
#
# Authors: Daniel Wagner <[email protected]>
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- 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
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: enable foreign arch
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
- name: Login to GitHub Container Registry
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- 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-alpine:
name: musl libc build on Alpine
runs-on: ubuntu-latest
container:
image: ghcr.io/linux-nvme/alpine:latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Mark repo as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: build
run: |
scripts/build.sh distro
windows-msys2-ucrt64:
runs-on: windows-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: msys2/setup-msys2@cafece8e6baf9247cf9b1bf95097b0b983cc558d # v2.31.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
- 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 gcc
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: failure()
with:
name: windows-msys2-ucrt64-logs
path: |
.build-ci/meson-logs/*.txt