Repository navigation
235 lines (213 loc) · 9.39 KB
/
Copy pathenterprise.yml
File metadata and controls
235 lines (213 loc) · 9.39 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
name: Enterprise Build Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'release/**' ]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ '*' ]
# Weekday-morning cron (10:00 UTC) seeds the master-scoped ccache that PR runs
# restore, by re-running --build-only (compile only, no tests) on the
# default branch. PR runs are read-only.
schedule:
- cron: '46 10 * * 1-5'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
# END OF COMMON SECTION
jobs:
# --enable-enterprise and the --disable-/--enable- overrides it has to
# yield to, through autotools. All configs build on one runner via
# .github/scripts/parallel-make-check.py (see os-check.yml for the full
# pattern): each config in its own out-of-tree ("VPATH") build directory
# off one checkout/autogen, checks on a pool of one-per-CPU worker
# threads, longest first. bubblewrap gives every test script its own
# network namespace so concurrent checks cannot collide on TCP/UDP ports
# (do not set AM_BWRAPPED here - that would disable it).
make_check:
name: make check
strategy:
fail-fast: false
matrix:
shard: [1, 2]
if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
runs-on: ubuntu-24.04
# Generous for a cold ccache; warm reruns finish in a fraction.
timeout-minutes: 45
steps:
- uses: actions/checkout@v5
name: Checkout wolfSSL
# tlslite-ng is consumed by scripts/multi-msg-record.test (run from
# `make check`); without it that test is SKIPped.
- uses: actions/setup-python@v6
with:
python-version: '3.x'
- run: pip install tlslite-ng
- name: Install dependencies
uses: ./.github/actions/install-apt-deps
with:
packages: autoconf automake libtool build-essential bubblewrap
ghcr-debs-tag: ubuntu-24.04-minimal
# ccache via the cross-platform composite; the script passes the
# compiler to configure as CC="ccache gcc" (or a per-config "cc").
- name: Set up ccache
uses: ./.github/actions/ccache-setup
with:
workflow-id: enterprise
config-hash: shard-${{ matrix.shard }}
max-size: 500M
# PRs read the cache the weekday seed writes; they never
# save, so PR runs add nothing to the Actions cache.
read-only: ${{ github.event_name == 'pull_request' }}
# Ubuntu 24.04 can restrict unprivileged user namespaces via AppArmor,
# which would stop the test scripts from re-execing under
# bwrap --unshare-net (their port-isolation mechanism).
- name: Allow unprivileged user namespaces (for bwrap)
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true
# The config list lives in .github/configs/enterprise.json; add new
# configs there as new entries (a "comment" key is allowed for notes).
# "minutes" is the expected duration driving longest-first scheduling
# and shard balancing: take it from the Minutes column of a previous
# run's step summary (one whose ccache hit), or omit it for a new
# config (defaults to 1) and refresh later.
# --private-dir=certs gives every build dir its own certs/ copy:
# crl-gen-openssl.test writes generated CRLs under certs/crl/, which
# would race through the shared VPATH certs symlink.
- name: Build and make check this shard's configs (parallel, out-of-tree)
run: |
.github/scripts/parallel-make-check.py \
${{ github.event_name == 'schedule' && '--build-only' || '' }} \
--shard "${{ matrix.shard }}/${{ strategy.job-total }}" \
--extra-cflags='-pedantic -Wdeclaration-after-statement -Wnull-dereference -Wno-overlength-strings -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE' \
--private-dir=certs \
.github/configs/enterprise.json
- name: ccache stats
if: always()
run: ccache -s || true
- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v6
with:
retention-days: 7
name: enterprise-logs-${{ matrix.shard }}
path: |
build-*/make-check.log
build-*/test-suite.log
build-*/config.log
if-no-files-found: ignore
# -DWOLFSSL_ENTERPRISE=yes and the overrides it has to yield to, through
# CMake. The CMake bundle is a separate implementation of the configure.ac
# one (force_option()/default_option() cascade in CMakeLists.txt), so it
# gets its own build-and-ctest per variant rather than relying on the
# autotools job above.
cmake:
name: cmake (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
include:
- name: enterprise
options: ''
# TLS 1.0 pulls old TLS back on, so -DWOLFSSL_OLD_TLS=no has to
# suppress the bundle's TLS 1.0 default as well.
- name: no-old-tls
options: '-DWOLFSSL_OLD_TLS=no'
# Without the OSP bundles nothing turns 3DES back on, so the
# bundle's DES3 exclusion takes effect, and nothing else supplies
# the OPENSSL_COMPATIBLE_DEFAULTS companion defines.
- name: no-all-osp
options: '-DWOLFSSL_ALL_OSP=no'
# Mutually exclusive with secure renegotiation, which the bundle
# must then leave off.
- name: renegotiation-indication
options: '-DWOLFSSL_RENEGOTIATION_INDICATION=yes'
if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
name: Checkout wolfSSL
- name: Install dependencies
uses: ./.github/actions/install-apt-deps
with:
packages: cmake build-essential
ghcr-debs-tag: ubuntu-24.04-full
# ccache-setup puts its compiler symlinks first on PATH, so CMake's
# compiler detection picks up the ccache-wrapped gcc unchanged.
- name: Set up ccache
uses: ./.github/actions/ccache-setup
with:
workflow-id: enterprise-cmake
config-hash: ${{ matrix.name }}
max-size: 200M
read-only: ${{ github.event_name == 'pull_request' }}
- name: Configure
run: |
cmake -B build -DWOLFSSL_ENTERPRISE=yes ${{ matrix.options }}
# Applications only see what wolfssl/options.h defines: a bundle
# define without a cmake/options.h.in entry changes the library's
# structure layouts behind their back.
- name: Check options.h exports every library define
run: |
missing=$(.github/scripts/cmake-config-defines.sh names build)
if [ -n "$missing" ]; then
echo "::error::Not exported by cmake/options.h.in:" $missing
exit 1
fi
- name: Build
run: cmake --build build -j "$(nproc)"
- name: Test
if: ${{ github.event_name != 'schedule' }}
working-directory: build
run: ctest -j "$(nproc)" --output-on-failure
- name: ccache stats
if: always()
run: ccache -s || true
# Re-running CMake in an existing build directory must give the same
# configuration as a fresh one: option values an earlier configure chose
# are recomputed (wolfssl_forget_auto_options()), while values the user
# set are kept. Configure only - nothing is built.
cmake_reconfigure:
name: cmake reconfigure
if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }}
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
name: Checkout wolfSSL
- name: Install dependencies
uses: ./.github/actions/install-apt-deps
with:
packages: cmake build-essential
ghcr-debs-tag: ubuntu-24.04-full
# Each case configures with FIRST, re-runs in the same directory with
# SECOND, and compares the result with a fresh configure of EXPECTED
# (SECOND, unless a user value from FIRST is meant to carry over).
- name: Compare re-runs with fresh configures
run: |
defs=.github/scripts/cmake-config-defines.sh
fail=0
check() {
local name=$1 first=$2 second=$3 expected=$4
cmake -B "rerun-$name" $first > /dev/null
cmake -B "rerun-$name" $second > /dev/null
cmake -B "fresh-$name" $expected > /dev/null
for kind in lib header; do
if ! diff <($defs $kind "fresh-$name") \
<($defs $kind "rerun-$name"); then
echo "::error::$name: re-run $kind defines differ"
fail=1
fi
done
}
ent="-DWOLFSSL_ENTERPRISE=yes"
check enable "" "$ent" "$ent"
check disable "$ent" "-DWOLFSSL_ENTERPRISE=no" ""
check keep-user "$ent -DWOLFSSL_SMIME=no" "" \
"$ent -DWOLFSSL_SMIME=no"
check add-user "$ent" "$ent -DWOLFSSL_SMIME=no" \
"$ent -DWOLFSSL_SMIME=no"
check app-bundle "-DWOLFSSL_QUIC=yes" "-DWOLFSSL_QUIC=no" ""
exit $fail