1 # Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved.
3 # Licensed under the Apache License 2.0 (the "License"). You may not use
4 # this file except in compliance with the License. You can obtain a copy
5 # in the file LICENSE in the source distribution or at
6 # https://www.openssl.org/source/license.html
10 on: [pull_request, push]
12 # for some reason, this does not work:
15 # HARNESS_JOBS: "${HARNESS_JOBS:-4}"
17 # for some reason, this does not work:
29 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
31 - name: install unifdef
34 sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install unifdef
35 - uses: actions/checkout@v4
39 run: ./config --banner=Configured --strict-warnings enable-fips && perl configdata.pm --dump
40 - name: make build_generated
41 run: make -s build_generated
45 run: git diff --exit-code
48 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
50 - uses: actions/checkout@v4
52 run: ./config --banner=Configured --strict-warnings enable-fips && perl configdata.pm --dump
53 - name: make build_generated
54 run: make -s build_generated
64 # This checks that we use ANSI C language syntax and semantics.
65 # We are not as strict with libraries, but rather adapt to what's
66 # expected to be available in a certain version of each platform.
68 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
70 - uses: actions/checkout@v4
72 run: CPPFLAGS=-ansi ./config --banner=Configured no-asm no-makedepend enable-buildtest-c++ enable-fips --strict-warnings -D_DEFAULT_SOURCE && perl configdata.pm --dump
77 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
79 - uses: actions/checkout@v4
80 - name: checkout fuzz/corpora submodule
81 run: git submodule update --init --depth 1 fuzz/corpora
83 run: sudo locale-gen tr_TR.UTF-8
85 # enable-quic is on by default, but we leave it here to check we're testing the explicit enable somewhere
86 run: CC=gcc ./config --banner=Configured enable-fips enable-quic --strict-warnings && perl configdata.pm --dump
92 ./util/opensslwrap.sh version -c
94 run: .github/workflows/make-test
95 - name: save artifacts
96 uses: actions/upload-artifact@v4
102 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
104 - uses: actions/checkout@v4
105 - name: checkout fuzz/corpora submodule
106 run: git submodule update --init --depth 1 fuzz/corpora
108 run: CC=clang ./config --banner=Configured no-fips --strict-warnings && perl configdata.pm --dump
114 ./util/opensslwrap.sh version -c
116 run: .github/workflows/make-test
117 - name: save artifacts
118 uses: actions/upload-artifact@v4
120 name: "ci@basic-clang"
124 if: github.repository == 'openssl/openssl'
127 os: [freebsd-13.2, ubuntu-arm64-22.04]
128 runs-on: ${{ matrix.os }}-self-hosted
129 continue-on-error: true
131 - uses: actions/checkout@v4
133 run: ./config enable-fips enable-ec_nistp_64_gcc_128 enable-md2 enable-rc5 enable-ssl3 enable-ssl3-method enable-trace
135 run: ./configdata.pm --dump
139 run: ./util/opensslwrap.sh version -c
141 run: .github/workflows/make-test
142 - name: save artifacts
143 uses: actions/upload-artifact@v4
145 name: "ci@self-hosted-${{ matrix.os }}"
149 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
151 - uses: actions/checkout@v4
152 - name: checkout fuzz/corpora submodule
153 run: git submodule update --init --depth 1 fuzz/corpora
155 run: ./config --banner=Configured --strict-warnings no-bulk no-pic no-asm -DOPENSSL_NO_SECURE_MEMORY -DOPENSSL_SMALL_FOOTPRINT && perl configdata.pm --dump
157 run: make -j4 # verbose, so no -s here
161 ./util/opensslwrap.sh version -c
163 run: .github/workflows/make-test
164 - name: save artifacts
165 uses: actions/upload-artifact@v4
169 if-no-files-found: ignore
172 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
174 - uses: actions/checkout@v4
175 - name: checkout fuzz/corpora submodule
176 run: git submodule update --init --depth 1 fuzz/corpora
178 run: ./config --banner=Configured --strict-warnings no-deprecated enable-fips && perl configdata.pm --dump
184 ./util/opensslwrap.sh version -c
186 run: .github/workflows/make-test
187 - name: save artifacts
188 uses: actions/upload-artifact@v4
190 name: "ci@no-deprecated"
194 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
196 - uses: actions/checkout@v4
197 - name: checkout fuzz/corpora submodule
198 run: git submodule update --init --depth 1 fuzz/corpora
200 run: ./config --banner=Configured --strict-warnings no-shared no-fips && perl configdata.pm --dump
206 ./util/opensslwrap.sh version -c
208 run: .github/workflows/make-test
209 - name: save artifacts
210 uses: actions/upload-artifact@v4
212 name: "ci@no-shared-ubuntu"
219 os: [macos-13, macos-14]
220 if: github.server_url == 'https://github.com'
221 runs-on: ${{ matrix.os }}
223 - uses: actions/checkout@v4
224 - name: checkout fuzz/corpora submodule
225 run: git submodule update --init --depth 1 fuzz/corpora
227 run: ./config --banner=Configured --strict-warnings no-shared no-fips && perl configdata.pm --dump
233 ./util/opensslwrap.sh version -c
235 run: .github/workflows/make-test
236 - name: save artifacts
237 uses: actions/upload-artifact@v4
239 name: "ci@no-shared-macos"
243 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
245 - uses: actions/checkout@v4
246 - name: checkout fuzz/corpora submodule
247 run: git submodule update --init --depth 1 fuzz/corpora
248 - name: Adjust ASLR for sanitizer
250 sudo cat /proc/sys/vm/mmap_rnd_bits
251 sudo sysctl -w vm.mmap_rnd_bits=28
253 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
259 ./util/opensslwrap.sh version -c
261 run: .github/workflows/make-test 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]"
262 - name: save artifacts
263 uses: actions/upload-artifact@v4
265 name: "ci@non-caching"
268 address_ub_sanitizer:
269 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
271 - uses: actions/checkout@v4
272 - name: checkout fuzz/corpora submodule
273 run: git submodule update --init --depth 1 fuzz/corpora
274 - name: Adjust ASLR for sanitizer
276 sudo cat /proc/sys/vm/mmap_rnd_bits
277 sudo sysctl -w vm.mmap_rnd_bits=28
279 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
285 ./util/opensslwrap.sh version -c
287 run: .github/workflows/make-test OPENSSL_TEST_RAND_ORDER=0
288 - name: save artifacts
289 uses: actions/upload-artifact@v4
291 name: "ci@address_ub_sanitizer"
295 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
297 - uses: actions/checkout@v4
298 - name: checkout fuzz/corpora submodule
299 run: git submodule update --init --depth 1 fuzz/corpora
300 - name: Adjust ASLR for sanitizer
302 sudo cat /proc/sys/vm/mmap_rnd_bits
303 sudo sysctl -w vm.mmap_rnd_bits=28
305 run: ./config --banner=Configured --debug -DPEDANTIC -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION enable-asan enable-ubsan enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 enable-weak-ssl-ciphers enable-ssl3 enable-ssl3-method enable-nextprotoneg && perl configdata.pm --dump
311 ./util/opensslwrap.sh version -c
313 run: .github/workflows/make-test OPENSSL_TEST_RAND_ORDER=0 TESTS="test_fuzz*"
314 - name: save artifacts
315 uses: actions/upload-artifact@v4
317 name: "ci@fuzz_tests"
319 if-no-files-found: ignore
322 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
324 - uses: actions/checkout@v4
325 - name: checkout fuzz/corpora submodule
326 run: git submodule update --init --depth 1 fuzz/corpora
327 - name: Adjust ASLR for sanitizer
329 sudo cat /proc/sys/vm/mmap_rnd_bits
330 sudo sysctl -w vm.mmap_rnd_bits=28
332 # --debug -O1 is to produce a debug build that runs in a reasonable amount of time
333 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
339 ./util/opensslwrap.sh version -c
341 run: .github/workflows/make-test OPENSSL_TEST_RAND_ORDER=0
342 - name: save artifacts
343 uses: actions/upload-artifact@v4
345 name: "ci@memory_sanitizer"
349 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
351 - uses: actions/checkout@v4
352 - name: checkout fuzz/corpora submodule
353 run: git submodule update --init --depth 1 fuzz/corpora
354 - name: Adjust ASLR for sanitizer
356 sudo cat /proc/sys/vm/mmap_rnd_bits
357 sudo sysctl -w vm.mmap_rnd_bits=28
359 run: CC=clang ./config --banner=Configured no-fips --strict-warnings -fsanitize=thread && perl configdata.pm --dump
365 ./util/opensslwrap.sh version -c
367 run: .github/workflows/make-test V=1 TESTS="test_threads test_internal_provider test_provfetch test_provider test_pbe test_evp_kdf test_pkcs12 test_store test_evp test_quic*"
368 - name: save artifacts
369 uses: actions/upload-artifact@v4
371 name: "ci@threads_sanitizer"
374 enable_non-default_options:
375 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
377 - uses: actions/checkout@v4
378 - name: checkout fuzz/corpora submodule
379 run: git submodule update --init --depth 1 fuzz/corpora
381 run: sudo modprobe tls
383 run: ./config --banner=Configured --strict-warnings no-ec enable-ssl-trace enable-zlib enable-zlib-dynamic enable-crypto-mdebug enable-egd enable-ktls enable-fips no-threads && perl configdata.pm --dump
389 ./util/opensslwrap.sh version -c
391 run: .github/workflows/make-test
392 - name: save artifacts
393 uses: actions/upload-artifact@v4
395 name: "ci@enable_non-default_options"
399 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
401 - uses: actions/checkout@v4
402 - name: checkout fuzz/corpora submodule
403 run: git submodule update --init --depth 1 fuzz/corpora
405 run: sudo modprobe tls
407 run: sudo modprobe sctp
408 - name: Enable auth in sctp
409 run: sudo sysctl -w net.sctp.auth_enable=1
410 - name: install extra config support
411 run: sudo apt-get -y install libsctp-dev abigail-tools libzstd-dev zstd
413 run: ./config --banner=Configured --strict-warnings enable-ktls enable-fips enable-egd enable-ec_nistp_64_gcc_128 enable-md2 enable-rc5 enable-sctp enable-ssl3 enable-ssl3-method enable-trace enable-zlib enable-zstd && perl configdata.pm --dump
419 ./util/opensslwrap.sh version -c
421 run: .github/workflows/make-test
422 - name: save artifacts
423 uses: actions/upload-artifact@v4
425 name: "ci@full_featured"
429 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
431 - uses: actions/checkout@v4
432 - name: checkout fuzz/corpora submodule
433 run: git submodule update --init --depth 1 fuzz/corpora
435 run: ./config --banner=Configured --strict-warnings no-legacy enable-fips && perl configdata.pm --dump
441 ./util/opensslwrap.sh version -c
443 run: .github/workflows/make-test
444 - name: save artifacts
445 uses: actions/upload-artifact@v4
451 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
453 - uses: actions/checkout@v4
454 - name: checkout fuzz/corpora submodule
455 run: git submodule update --init --depth 1 fuzz/corpora
457 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
463 ./util/opensslwrap.sh version -c
465 run: .github/workflows/make-test
466 - name: save artifacts
467 uses: actions/upload-artifact@v4
472 # out-of-source-and-install checks multiple things at the same time:
473 # - That building, testing and installing works from an out-of-source
475 # - That building, testing and installing works with a read-only source
477 out-of-readonly-source-and-install-ubuntu:
478 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
480 - uses: actions/checkout@v4
483 - name: checkout fuzz/corpora submodule
484 run: git submodule update --init --depth 1 fuzz/corpora
485 working-directory: ./source
486 - name: make source read-only
487 run: chmod -R a-w ./source
488 - name: create build and install directories
494 ../source/config --banner=Configured enable-fips enable-quic enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd)
495 perl configdata.pm --dump
496 working-directory: ./build
499 working-directory: ./build
503 ./util/opensslwrap.sh version -c
504 working-directory: ./build
506 run: ../source/.github/workflows/make-test
507 working-directory: ./build
508 - name: save artifacts
509 uses: actions/upload-artifact@v4
511 name: "ci@out-of-readonly-source-and-install-ubuntu"
512 path: build/artifacts/
515 working-directory: ./build
517 out-of-readonly-source-and-install-macos:
521 os: [macos-13, macos-14]
522 runs-on: ${{ matrix.os }}
523 if: github.server_url == 'https://github.com'
525 - uses: actions/checkout@v4
528 - name: checkout fuzz/corpora submodule
529 run: git submodule update --init --depth 1 fuzz/corpora
530 working-directory: ./source
531 - name: make source read-only
532 run: chmod -R a-w ./source
533 - name: create build and install directories
539 ../source/config --banner=Configured enable-fips enable-quic enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd)
540 perl configdata.pm --dump
541 working-directory: ./build
544 working-directory: ./build
548 ./util/opensslwrap.sh version -c
549 working-directory: ./build
551 run: ../source/.github/workflows/make-test
552 working-directory: ./build
553 - name: save artifacts
554 uses: actions/upload-artifact@v4
556 name: "ci@out-of-readonly-source-and-install-macos"
557 path: build/artifacts/
560 working-directory: ./build
563 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
565 - uses: actions/checkout@v4
567 submodules: recursive
568 - name: package installs
571 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
572 - name: install cpanm and Test2::V0 for gost_engine testing
573 uses: perl-actions/install-with-cpanm@v1
576 - name: setup hostname workaround
577 run: sudo hostname localhost
579 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
585 ./util/opensslwrap.sh version -c
586 - name: test external gost-engine
587 run: make test TESTS="test_external_gost_engine"
588 - name: test external krb5
589 run: make test TESTS="test_external_krb5"
590 - name: test external_tlsfuzzer
591 run: make test TESTS="test_external_tlsfuzzer"
592 - name: test external oqs-provider
593 run: make test TESTS="test_external_oqsprovider"
596 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
604 - uses: actions/checkout@v4
606 submodules: recursive
607 - name: Configure OpenSSL
608 run: ./config --banner=Configured --strict-warnings --debug enable-external-tests && perl configdata.pm --dump
612 uses: actions/setup-python@v5.0.0
614 python-version: ${{ matrix.PYTHON }}
615 - uses: dtolnay/rust-toolchain@master
617 toolchain: ${{ matrix.RUST }}
621 ./util/opensslwrap.sh version -c
622 - name: test external pyca
623 run: make test TESTS="test_external_pyca" VERBOSE=1
625 external-test-cf-quiche:
626 runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'ubuntu-22.04-self-hosted' }}
628 - uses: actions/checkout@v4
630 submodules: recursive
631 - name: Configure OpenSSL
632 run: ./config --banner=Configured --strict-warnings enable-external-tests && perl configdata.pm --dump
635 - uses: dtolnay/rust-toolchain@stable
639 ./util/opensslwrap.sh version -c
640 - name: test external Cloudflare quiche
641 run: make test TESTS="test_external_cf_quiche" VERBOSE=1