-
Notifications
You must be signed in to change notification settings - Fork 30
282 lines (250 loc) · 7.52 KB
/
testsuite.yml
File metadata and controls
282 lines (250 loc) · 7.52 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
name: testsuite
on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:
jobs:
#
# A quick and cheap test first before running other jobs
#
ubuntu:
timeout-minutes: 5
env:
PERL_USE_UNSAFE_INC: 0
AUTHOR_TESTING: 1
AUTOMATED_TESTING: 1
RELEASE_TESTING: 1
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v6
- run: openssl version
- run: perl -V
- name: uses install-with-cpm
uses: perl-actions/install-with-cpm@v1
with:
cpanfile: "cpanfile"
- name: Makefile.PL
run: perl -I$(pwd) Makefile.PL
- run: make && prove -wbvm t/*.t
#
# Valgrind memory leak detection on OpenSSL 3.x
#
valgrind:
timeout-minutes: 15
runs-on: ubuntu-latest
needs: [ubuntu]
name: "Valgrind (debian:bookworm)"
container: debian:bookworm
steps:
- uses: actions/checkout@v6
- name: Install dependencies
run: |
apt-get update
apt-get install -y openssl perl make gcc libssl-dev sudo curl valgrind
- name: uses install-with-cpm
uses: perl-actions/install-with-cpm@v1
with:
cpanfile: "cpanfile"
- name: Build
run: |
perl -I$(pwd) Makefile.PL
make
- name: Run tests under Valgrind
run: |
rc=0
for t in t/*.t; do
echo "=== valgrind: $t ==="
valgrind \
--leak-check=full \
--show-leak-kinds=definite \
--num-callers=20 \
--log-file=valgrind.log \
perl -Iblib/lib -Iblib/arch "$t"
# Only fail if RSA.so appears in a "definitely lost" stack trace.
# This filters out Perl-internal leaks (known false positives).
if perl -0777 -e '
my $log = do { local $/; <STDIN> };
my $found = 0;
for my $block (split /\n\n/, $log) {
if ($block =~ /definitely lost/ && $block =~ /RSA\.so/) {
print STDERR "LEAK from RSA.xs:\n$block\n\n";
$found = 1;
}
}
exit $found;
' < valgrind.log; then
echo " -> clean"
else
echo "Memory leak from RSA.xs in $t!"
rc=1
fi
done
exit $rc
openssl-matrix:
timeout-minutes: 5
env:
PERL_USE_UNSAFE_INC: 0
AUTHOR_TESTING: 1
AUTOMATED_TESTING: 1
RELEASE_TESTING: 1
runs-on: ubuntu-latest
needs: [ubuntu]
name: "OpenSSL ${{ matrix.os-version }}"
strategy:
fail-fast: false
matrix:
os-version:
# - debian:buster # OpenSSL 1.1.1
- debian:bullseye # OpenSSL 1.1.1
- debian:bookworm # OpenSSL 3.0.x
- debian:trixie # OpenSSL 3.4.x (Debian 13)
- almalinux:9 # OpenSSL with new crypto policies (RHEL-compatible)
container: ${{ matrix.os-version }}
steps:
- uses: actions/checkout@v6
- name: Install dependencies using apt-get
if: ${{ startsWith(matrix.os-version, 'debian:') }}
run: |
apt-get update
apt-get install -y openssl perl make gcc libssl-dev sudo curl
- name: Install dependencies using yum
if: ${{ matrix.os-version == 'almalinux:9' }}
run: |
yum install --skip-broken -y openssl perl make gcc openssl-devel sudo curl
- run: openssl version
- run: perl -V
- name: uses install-with-cpm
uses: perl-actions/install-with-cpm@v1
with:
cpanfile: "cpanfile"
- name: Makefile.PL
run: perl -I$(pwd) Makefile.PL
- run: make && prove -wbvm t/*.t
#
# List of Perl Versions available
#
perl-versions:
timeout-minutes: 5
runs-on: ubuntu-latest
needs: [openssl-matrix]
name: List Perl versions
outputs:
perl-versions: ${{ steps.action.outputs.perl-versions }}
steps:
- id: action
uses: perl-actions/perl-versions@v2
with:
since-perl: v5.10
with-devel: true
#
# The Perl matrix on linux
#
perl:
timeout-minutes: 5
env:
PERL_USE_UNSAFE_INC: 0
AUTHOR_TESTING: 1
AUTOMATED_TESTING: 1
RELEASE_TESTING: 1
runs-on: ubuntu-latest
needs: [openssl-matrix,perl-versions]
name: "Perl ${{ matrix.perl-version }}"
strategy:
fail-fast: false
matrix:
perl-version: ${{ fromJson (needs.perl-versions.outputs.perl-versions) }}
container: perldocker/perl-tester:${{ matrix.perl-version }}
steps:
- uses: actions/checkout@v6
- run: openssl version
- run: perl -V
- name: Deps for testing
run: |
cpanm --notest Crypt::OpenSSL::Random Crypt::OpenSSL::Guess Test::CPAN::Meta Perl::MinimumVersion Test::Pod::Coverage Test::Pod Test::MinimumVersion Crypt::OpenSSL::Bignum ||:
cpanm --notest Crypt::OpenSSL::Random Crypt::OpenSSL::Guess Test::CPAN::Meta Perl::MinimumVersion Test::Pod::Coverage Test::Pod Test::MinimumVersion Crypt::OpenSSL::Bignum
# not available < 5.12
cpanm --notest Test::Kwalitee ||:
- run: perl Makefile.PL
- run: make && prove -wbvm t/*.t
#
# Windows
#
windows:
timeout-minutes: 5
env:
PERL_USE_UNSAFE_INC: 0
AUTHOR_TESTING: 0
AUTOMATED_TESTING: 1
RELEASE_TESTING: 0
needs: [openssl-matrix, perl-versions]
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
perl-version: [latest]
steps:
- uses: actions/checkout@v6
- name: Set up Perl
run: |
# skip installing perl if it is already installed.
if (!(Test-Path "C:\strawberry\perl\bin")) {
choco install strawberryperl
}
echo @"
C:\strawberry\c\bin
C:\strawberry\perl\site\bin
C:\strawberry\perl\bin
"@ |
Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- run: openssl version
- run: perl -V
- name: Deps for testing
run: cpanm --notest Crypt::OpenSSL::Random Crypt::OpenSSL::Guess
- run: perl Makefile.PL
- run: make && prove -wbvm t/*.t
#
# macOS — covers LibreSSL (system default) and Homebrew OpenSSL 3.x
#
macos:
timeout-minutes: 5
env:
PERL_USE_UNSAFE_INC: 0
AUTHOR_TESTING: 0
AUTOMATED_TESTING: 1
RELEASE_TESTING: 0
needs: [ubuntu]
runs-on: macos-latest
name: "macOS - ${{ matrix.ssl }}"
strategy:
fail-fast: false
matrix:
include:
- ssl: system LibreSSL
openssl_prefix: ""
- ssl: Homebrew OpenSSL
openssl_prefix: HOMEBREW
steps:
- uses: actions/checkout@v6
- name: Install Homebrew OpenSSL
if: ${{ matrix.openssl_prefix == 'HOMEBREW' }}
run: brew install openssl@3
- name: Set OPENSSL_PREFIX for Homebrew OpenSSL
if: ${{ matrix.openssl_prefix == 'HOMEBREW' }}
run: echo "OPENSSL_PREFIX=$(brew --prefix openssl@3)" >> "$GITHUB_ENV"
- run: openssl version
- run: perl -V
- name: Install cpanm
run: |
curl -L https://cpanmin.us/ -o cpanm
chmod +x cpanm
sudo mv cpanm /usr/local/bin/
- name: Install dependencies
run: cpanm --notest Crypt::OpenSSL::Guess Crypt::OpenSSL::Random Crypt::OpenSSL::Bignum
- name: Makefile.PL
run: perl Makefile.PL
- run: make && prove -wbvm t/*.t