Test ktls in non-default options CI build
[openssl.git] / .github / workflows / ci.yml
1 name: GitHub CI
2
3 on: [pull_request, push]
4
5 # for some reason, this does not work:
6 # variables:
7 #   BUILDOPTS: "-j4"
8 #   HARNESS_JOBS: "${HARNESS_JOBS:-4}"
9
10 # for some reason, this does not work:
11 # before_script:
12 #     - make="make -s"
13
14 jobs:
15   check_update:
16     runs-on: ubuntu-latest
17     steps:
18     - name: install unifdef
19       run: |
20         sudo apt-get update
21         sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install unifdef
22     - uses: actions/checkout@v2
23     - name: config
24       run: ./config --banner=Configured --strict-warnings enable-fips && perl configdata.pm --dump
25     - name: make build_generated
26       run: make -s build_generated
27     - name: make update
28       run: make update
29     - name: git diff
30       run: git diff --exit-code
31
32   check_docs:
33     runs-on: ubuntu-latest
34     steps:
35     - uses: actions/checkout@v2
36     - name: config
37       run: ./config --banner=Configured --strict-warnings enable-fips && perl configdata.pm --dump
38     - name: make build_generated
39       run: make -s build_generated
40     - name: make doc-nits
41       run: make doc-nits
42     - name: make md-nits
43       run: |
44           sudo gem install mdl
45           make md-nits
46
47   # This checks that we use ANSI C language syntax and semantics.
48   # We are not as strict with libraries, but rather adapt to what's
49   # expected to be available in a certain version of each platform.
50   check-ansi:
51     runs-on: ubuntu-latest
52     steps:
53     - uses: actions/checkout@v2
54     - name: config
55       run: CPPFLAGS=-ansi ./config --banner=Configured no-asm no-makedepend enable-buildtest-c++ enable-fips --strict-warnings -D_DEFAULT_SOURCE && perl configdata.pm --dump
56     - name: make
57       run: make -s -j4
58
59   basic_gcc:
60     runs-on: ubuntu-latest
61     steps:
62     - uses: actions/checkout@v2
63     - name: config
64       run: ./config --banner=Configured enable-fips --strict-warnings && perl configdata.pm --dump
65     - name: make
66       run: make -s -j4
67     - name: make test
68       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
69
70   basic_clang:
71     runs-on: ubuntu-latest
72     steps:
73     - uses: actions/checkout@v2
74     - name: config
75       run: CC=clang ./config --banner=Configured no-fips --strict-warnings && perl configdata.pm --dump
76     - name: make
77       run: make -s -j4
78     - name: make test
79       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
80
81   minimal:
82     runs-on: ubuntu-latest
83     steps:
84     - uses: actions/checkout@v2
85     - name: config
86       run: ./config --banner=Configured --strict-warnings no-bulk no-pic no-asm -DOPENSSL_NO_SECURE_MEMORY -DOPENSSL_SMALL_FOOTPRINT && perl configdata.pm --dump
87     - name: make
88       run: make -j4 # verbose, so no -s here
89     - name: make test
90       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
91
92   no-deprecated:
93     runs-on: ubuntu-latest
94     steps:
95     - uses: actions/checkout@v2
96     - name: config
97       run: ./config --banner=Configured --strict-warnings no-deprecated enable-fips && perl configdata.pm --dump
98     - name: make
99       run: make -s -j4
100     - name: make test
101       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
102
103   no-shared:
104     strategy:
105       matrix:
106         os: [ ubuntu-latest, macos-latest ]
107     runs-on: ${{matrix.os}}
108     steps:
109     - uses: actions/checkout@v2
110     - name: config
111       run: ./config --banner=Configured --strict-warnings no-shared no-fips && perl configdata.pm --dump
112     - name: make
113       run: make -s -j4
114     - name: make test
115       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
116
117   non-caching:
118     runs-on: ubuntu-latest
119     steps:
120     - uses: actions/checkout@v2
121     - name: config
122       run: ./config --banner=Configured --debug enable-asan enable-ubsan no-cached-fetch no-fips no-dtls no-tls1 no-tls1-method no-tls1_1 no-tls1_1-method no-async && perl configdata.pm --dump
123     - name: make
124       run: make -s -j4
125     - name: make test
126       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0 TESTS="-test_fuzz* -test_ssl_* -test_sslapi -test_evp -test_cmp_http -test_verify -test_cms -test_store -test_enc -[01][0-9]"
127
128   address_ub_sanitizer:
129     runs-on: ubuntu-latest
130     steps:
131     - uses: actions/checkout@v2
132     - name: config
133       run: ./config --banner=Configured --debug enable-asan enable-ubsan enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 enable-fips && perl configdata.pm --dump
134     - name: make
135       run: make -s -j4
136     - name: make test
137       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
138
139   memory_sanitizer:
140     runs-on: ubuntu-latest
141     steps:
142     - uses: actions/checkout@v2
143     - name: config
144       # --debug -O1 is to produce a debug build that runs in a reasonable amount of time
145       run: CC=clang ./config --banner=Configured --debug -O1 -fsanitize=memory -DOSSL_SANITIZE_MEMORY -fno-optimize-sibling-calls enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 enable-fips && perl configdata.pm --dump
146     - name: make
147       run: make -s -j4
148     - name: make test
149       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
150
151   threads_sanitizer:
152     runs-on: ubuntu-latest
153     steps:
154     - uses: actions/checkout@v2
155     - name: config
156       run: CC=clang ./config --banner=Configured no-fips --strict-warnings -fsanitize=thread && perl configdata.pm --dump
157     - name: make
158       run: make -s -j4
159     - name: make test
160       run: make TESTS=test_threads test HARNESS_JOBS=${HARNESS_JOBS:-4}
161
162   enable_non-default_options:
163     runs-on: ubuntu-latest
164     steps:
165     - uses: actions/checkout@v2
166     - name: modprobe tls
167       run: sudo modprobe tls
168     - name: config
169       run: ./config --banner=Configured --strict-warnings no-ec enable-ssl-trace enable-zlib enable-zlib-dynamic enable-crypto-mdebug enable-crypto-mdebug-backtrace enable-egd enable-ktls enable-fips && perl configdata.pm --dump
170     - name: make
171       run: make -s -j4
172     - name: make test
173       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
174
175   no-legacy:
176     runs-on: ubuntu-latest
177     steps:
178     - uses: actions/checkout@v2
179     - name: config
180       run: ./config --banner=Configured --strict-warnings no-legacy enable-fips && perl configdata.pm --dump
181     - name: make
182       run: make -s -j4
183     - name: make test
184       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
185
186   legacy:
187     runs-on: ubuntu-latest
188     steps:
189     - uses: actions/checkout@v2
190     - name: config
191       run: ./config --banner=Configured -Werror --debug no-afalgeng no-shared enable-crypto-mdebug enable-rc5 enable-md2 enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers enable-zlib enable-ec_nistp_64_gcc_128 no-fips && perl configdata.pm --dump
192     - name: make
193       run: make -s -j4
194     - name: make test
195       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
196
197   buildtest:
198     runs-on: ubuntu-latest
199     steps:
200     - uses: actions/checkout@v2
201     - name: config
202       run: ./config --banner=Configured no-asm no-makedepend enable-buildtest-c++ enable-fips --strict-warnings -D_DEFAULT_SOURCE && perl configdata.pm --dump
203     - name: make
204       run: make -s -j4
205     - name: make test
206       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
207
208   out-of-source-and-install:
209     strategy:
210       matrix:
211         os: [ubuntu-latest, macos-latest ]
212     runs-on: ${{matrix.os}}
213     steps:
214     - uses: actions/checkout@v2
215     - name: extra preparations
216       run: |
217         mkdir ./build
218         mkdir ./install
219     - name: config
220       run: ../config --banner=Configured enable-fips enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd) && perl configdata.pm --dump
221       working-directory: ./build
222     - name: make
223       run: make -s -j4
224       working-directory: ./build
225     - name: make test
226       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
227       working-directory: ./build
228     - name: make install
229       run: make install
230       working-directory: ./build
231
232   external-tests:
233     runs-on: ubuntu-latest
234     steps:
235     - uses: actions/checkout@v2
236       with:
237         submodules: recursive
238     - name: package installs
239       run: |
240         sudo apt-get update
241         sudo apt-get -yq install bison gettext keyutils ldap-utils libldap2-dev libkeyutils-dev python3 python3-paste python3-pyrad slapd tcsh python3-virtualenv virtualenv python3-kdcproxy
242     - name: install cpanm and Test2::V0 for gost_engine testing
243       uses: perl-actions/install-with-cpanm@v1
244       with:
245         install: Test2::V0
246     - name: setup hostname workaround
247       run: sudo hostname localhost
248     - name: config
249       run: ./config --banner=Configured --strict-warnings --debug no-afalgeng enable-rc5 enable-md2 enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers enable-zlib enable-ec_nistp_64_gcc_128 enable-external-tests no-fips && perl configdata.pm --dump
250     - name: make
251       run: make -s -j4
252     - name: test external gost-engine
253       run: make test TESTS="test_external_gost_engine"
254     - name: test external krb5
255       run: make test TESTS="test_external_krb5"
256
257   external-test-pyca:
258     runs-on: ubuntu-latest
259     strategy:
260       matrix:
261         RUST:
262           - 1.51.0
263         PYTHON:
264           - 3.9
265     steps:
266     - uses: actions/checkout@v2
267       with:
268         submodules: recursive
269     - name: Configure OpenSSL
270       run: ./config --banner=Configured --strict-warnings --debug enable-external-tests && perl configdata.pm --dump
271     - name: make
272       run: make -s -j4
273     - name: Setup Python
274       uses: actions/setup-python@v2.2.2
275       with:
276         python-version: ${{ matrix.PYTHON }}
277     - uses: actions-rs/toolchain@v1
278       with:
279         profile: minimal
280         toolchain: ${{ matrix.RUST }}
281         override: true
282         default: true
283     - name: test external pyca
284       run: make test TESTS="test_external_pyca" VERBOSE=1