ci.yml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. # Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved.
  2. #
  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
  7. name: GitHub CI
  8. on: [pull_request, push]
  9. # for some reason, this does not work:
  10. # variables:
  11. # BUILDOPTS: "-j4"
  12. # HARNESS_JOBS: "${HARNESS_JOBS:-4}"
  13. # for some reason, this does not work:
  14. # before_script:
  15. # - make="make -s"
  16. permissions:
  17. contents: read
  18. jobs:
  19. check_update:
  20. runs-on: ubuntu-latest
  21. steps:
  22. - name: install unifdef
  23. run: |
  24. sudo apt-get update
  25. sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install unifdef
  26. - uses: actions/checkout@v4
  27. with:
  28. fetch-depth: 0
  29. - name: config
  30. run: ./config --banner=Configured --strict-warnings enable-fips && perl configdata.pm --dump
  31. - name: make build_generated
  32. run: make -s build_generated
  33. - name: make update
  34. run: make update
  35. - name: git diff
  36. run: git diff --exit-code
  37. check_docs:
  38. runs-on: ubuntu-latest
  39. steps:
  40. - uses: actions/checkout@v4
  41. - name: config
  42. run: ./config --banner=Configured --strict-warnings enable-fips && perl configdata.pm --dump
  43. - name: make build_generated
  44. run: make -s build_generated
  45. - name: make doc-nits
  46. run: make doc-nits
  47. - name: make help
  48. run: make help
  49. - name: make md-nits
  50. run: |
  51. sudo gem install mdl
  52. make md-nits
  53. # This checks that we use ANSI C language syntax and semantics.
  54. # We are not as strict with libraries, but rather adapt to what's
  55. # expected to be available in a certain version of each platform.
  56. check-ansi:
  57. runs-on: ubuntu-latest
  58. steps:
  59. - uses: actions/checkout@v4
  60. - name: config
  61. run: CPPFLAGS=-ansi ./config --banner=Configured no-asm no-makedepend enable-buildtest-c++ enable-fips --strict-warnings -D_DEFAULT_SOURCE && perl configdata.pm --dump
  62. - name: make
  63. run: make -s -j4
  64. basic_gcc:
  65. runs-on: ubuntu-latest
  66. steps:
  67. - uses: actions/checkout@v4
  68. - name: checkout fuzz/corpora submodule
  69. run: git submodule update --init --depth 1 fuzz/corpora
  70. - name: localegen
  71. run: sudo locale-gen tr_TR.UTF-8
  72. - name: config
  73. # enable-quic is on by default, but we leave it here to check we're testing the explicit enable somewhere
  74. run: CC=gcc ./config --banner=Configured enable-fips enable-quic --strict-warnings && perl configdata.pm --dump
  75. - name: make
  76. run: make -s -j4
  77. - name: make test
  78. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  79. basic_clang:
  80. runs-on: ubuntu-latest
  81. steps:
  82. - uses: actions/checkout@v4
  83. - name: checkout fuzz/corpora submodule
  84. run: git submodule update --init --depth 1 fuzz/corpora
  85. - name: config
  86. run: CC=clang ./config --banner=Configured no-fips --strict-warnings && perl configdata.pm --dump
  87. - name: make
  88. run: make -s -j4
  89. - name: make test
  90. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  91. minimal:
  92. runs-on: ubuntu-latest
  93. steps:
  94. - uses: actions/checkout@v4
  95. - name: checkout fuzz/corpora submodule
  96. run: git submodule update --init --depth 1 fuzz/corpora
  97. - name: config
  98. run: ./config --banner=Configured --strict-warnings no-bulk no-pic no-asm -DOPENSSL_NO_SECURE_MEMORY -DOPENSSL_SMALL_FOOTPRINT && perl configdata.pm --dump
  99. - name: make
  100. run: make -j4 # verbose, so no -s here
  101. - name: make test
  102. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  103. no-deprecated:
  104. runs-on: ubuntu-latest
  105. steps:
  106. - uses: actions/checkout@v4
  107. - name: checkout fuzz/corpora submodule
  108. run: git submodule update --init --depth 1 fuzz/corpora
  109. - name: config
  110. run: ./config --banner=Configured --strict-warnings no-deprecated enable-fips && perl configdata.pm --dump
  111. - name: make
  112. run: make -s -j4
  113. - name: make test
  114. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  115. no-shared:
  116. strategy:
  117. matrix:
  118. os: [ ubuntu-latest, macos-latest ]
  119. runs-on: ${{matrix.os}}
  120. steps:
  121. - uses: actions/checkout@v4
  122. - name: checkout fuzz/corpora submodule
  123. run: git submodule update --init --depth 1 fuzz/corpora
  124. - name: config
  125. run: ./config --banner=Configured --strict-warnings no-shared no-fips && perl configdata.pm --dump
  126. - name: make
  127. run: make -s -j4
  128. - name: make test
  129. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  130. non-caching:
  131. runs-on: ubuntu-latest
  132. steps:
  133. - uses: actions/checkout@v4
  134. - name: checkout fuzz/corpora submodule
  135. run: git submodule update --init --depth 1 fuzz/corpora
  136. - name: config
  137. 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
  138. - name: make
  139. run: make -s -j4
  140. - name: make test
  141. 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]"
  142. address_ub_sanitizer:
  143. runs-on: ubuntu-latest
  144. steps:
  145. - uses: actions/checkout@v4
  146. - name: checkout fuzz/corpora submodule
  147. run: git submodule update --init --depth 1 fuzz/corpora
  148. - name: config
  149. run: ./config --banner=Configured --debug enable-asan enable-ubsan enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 enable-fips -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION && perl configdata.pm --dump
  150. - name: make
  151. run: make -s -j4
  152. - name: make test
  153. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
  154. memory_sanitizer:
  155. runs-on: ubuntu-latest
  156. steps:
  157. - uses: actions/checkout@v4
  158. - name: checkout fuzz/corpora submodule
  159. run: git submodule update --init --depth 1 fuzz/corpora
  160. - name: config
  161. # --debug -O1 is to produce a debug build that runs in a reasonable amount of time
  162. 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
  163. - name: make
  164. run: make -s -j4
  165. - name: make test
  166. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
  167. threads_sanitizer:
  168. runs-on: ubuntu-latest
  169. steps:
  170. - uses: actions/checkout@v4
  171. - name: checkout fuzz/corpora submodule
  172. run: git submodule update --init --depth 1 fuzz/corpora
  173. - name: config
  174. run: CC=clang ./config --banner=Configured no-fips --strict-warnings -fsanitize=thread && perl configdata.pm --dump
  175. - name: make
  176. run: make -s -j4
  177. - name: make test
  178. run: make 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*" test HARNESS_JOBS=${HARNESS_JOBS:-4}
  179. enable_non-default_options:
  180. runs-on: ubuntu-latest
  181. steps:
  182. - uses: actions/checkout@v4
  183. - name: checkout fuzz/corpora submodule
  184. run: git submodule update --init --depth 1 fuzz/corpora
  185. - name: modprobe tls
  186. run: sudo modprobe tls
  187. - name: config
  188. 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 no-threads && perl configdata.pm --dump
  189. - name: make
  190. run: make -s -j4
  191. - name: make test
  192. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  193. fips_and_ktls:
  194. runs-on: ubuntu-latest
  195. steps:
  196. - uses: actions/checkout@v4
  197. - name: checkout fuzz/corpora submodule
  198. run: git submodule update --init --depth 1 fuzz/corpora
  199. - name: modprobe tls
  200. run: sudo modprobe tls
  201. - name: config
  202. run: ./config --banner=Configured --strict-warnings enable-ktls enable-fips && 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. enable_brotli_dynamic:
  208. runs-on: ubuntu-latest
  209. steps:
  210. - name: install brotli
  211. run: |
  212. sudo apt-get update
  213. sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install brotli libbrotli1 libbrotli-dev
  214. - name: checkout openssl
  215. uses: actions/checkout@v4
  216. - name: checkout fuzz/corpora submodule
  217. run: git submodule update --init --depth 1 fuzz/corpora
  218. - name: config
  219. run: ./config enable-comp enable-brotli enable-brotli-dynamic && perl configdata.pm --dump
  220. - name: make
  221. run: make -s -j4
  222. - name: make test
  223. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  224. enable_zstd_dynamic:
  225. runs-on: ubuntu-latest
  226. steps:
  227. - name: install zstd
  228. run: |
  229. sudo apt-get update
  230. sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install zstd libzstd1 libzstd-dev
  231. - name: checkout openssl
  232. uses: actions/checkout@v4
  233. - name: checkout fuzz/corpora submodule
  234. run: git submodule update --init --depth 1 fuzz/corpora
  235. - name: config
  236. run: ./config enable-comp enable-zstd enable-zstd-dynamic && perl configdata.pm --dump
  237. - name: make
  238. run: make -s -j4
  239. - name: make test
  240. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  241. enable_brotli_and_zstd_dynamic:
  242. runs-on: ubuntu-latest
  243. steps:
  244. - name: install brotli and zstd
  245. run: |
  246. sudo apt-get update
  247. sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install brotli libbrotli1 libbrotli-dev
  248. sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install zstd libzstd1 libzstd-dev
  249. - name: checkout openssl
  250. uses: actions/checkout@v4
  251. - name: checkout fuzz/corpora submodule
  252. run: git submodule update --init --depth 1 fuzz/corpora
  253. - name: config
  254. run: ./config enable-comp enable-brotli enable-brotli-dynamic enable-zstd enable-zstd-dynamic && perl configdata.pm --dump
  255. - name: make
  256. run: make -s -j4
  257. - name: make test
  258. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  259. enable_brotli_and_asan_ubsan:
  260. runs-on: ubuntu-latest
  261. steps:
  262. - name: install brotli
  263. run: |
  264. sudo apt-get update
  265. sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install brotli libbrotli1 libbrotli-dev
  266. - name: checkout openssl
  267. uses: actions/checkout@v4
  268. - name: checkout fuzz/corpora submodule
  269. run: git submodule update --init --depth 1 fuzz/corpora
  270. - name: config
  271. run: ./config --banner=Configured --debug enable-asan enable-ubsan enable-comp enable-brotli -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -DPEDANTIC && perl configdata.pm --dump
  272. - name: make
  273. run: make -s -j4
  274. - name: make test
  275. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
  276. enable_zstd_and_asan_ubsan:
  277. runs-on: ubuntu-latest
  278. steps:
  279. - name: install zstd
  280. run: |
  281. sudo apt-get update
  282. sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install zstd libzstd1 libzstd-dev
  283. - name: checkout openssl
  284. uses: actions/checkout@v4
  285. - name: checkout fuzz/corpora submodule
  286. run: git submodule update --init --depth 1 fuzz/corpora
  287. - name: config
  288. run: ./config --banner=Configured --debug enable-asan enable-ubsan enable-comp enable-zstd -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -DPEDANTIC && perl configdata.pm --dump
  289. - name: make
  290. run: make -s -j4
  291. - name: make test
  292. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
  293. no-legacy:
  294. runs-on: ubuntu-latest
  295. steps:
  296. - uses: actions/checkout@v4
  297. - name: checkout fuzz/corpora submodule
  298. run: git submodule update --init --depth 1 fuzz/corpora
  299. - name: config
  300. run: ./config --banner=Configured --strict-warnings no-legacy enable-fips && perl configdata.pm --dump
  301. - name: make
  302. run: make -s -j4
  303. - name: make test
  304. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  305. legacy:
  306. runs-on: ubuntu-latest
  307. steps:
  308. - uses: actions/checkout@v4
  309. - name: checkout fuzz/corpora submodule
  310. run: git submodule update --init --depth 1 fuzz/corpora
  311. - name: config
  312. 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
  313. - name: make
  314. run: make -s -j4
  315. - name: make test
  316. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  317. enable-tfo:
  318. strategy:
  319. matrix:
  320. os: [ ubuntu-latest, macos-latest ]
  321. runs-on: ${{matrix.os}}
  322. steps:
  323. - uses: actions/checkout@v4
  324. - name: checkout fuzz/corpora submodule
  325. run: git submodule update --init --depth 1 fuzz/corpora
  326. - name: config
  327. run: CC=gcc ./config --banner=Configured enable-tfo --strict-warnings && perl configdata.pm --dump
  328. - name: make
  329. run: make -s -j4
  330. - name: make test
  331. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  332. buildtest:
  333. runs-on: ubuntu-latest
  334. steps:
  335. - uses: actions/checkout@v4
  336. - name: checkout fuzz/corpora submodule
  337. run: git submodule update --init --depth 1 fuzz/corpora
  338. - name: config
  339. run: ./config --banner=Configured no-asm no-makedepend enable-buildtest-c++ enable-fips --strict-warnings -D_DEFAULT_SOURCE && perl configdata.pm --dump
  340. - name: make
  341. run: make -s -j4
  342. - name: make test
  343. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  344. out-of-source-and-install:
  345. strategy:
  346. matrix:
  347. os: [ubuntu-latest, macos-latest ]
  348. runs-on: ${{matrix.os}}
  349. steps:
  350. - uses: actions/checkout@v4
  351. - name: checkout fuzz/corpora submodule
  352. run: git submodule update --init --depth 1 fuzz/corpora
  353. - name: extra preparations
  354. run: |
  355. mkdir ./build
  356. mkdir ./install
  357. - name: config
  358. run: ../config --banner=Configured enable-fips enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd) && perl configdata.pm --dump
  359. working-directory: ./build
  360. - name: make
  361. run: make -s -j4
  362. working-directory: ./build
  363. - name: make test
  364. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  365. working-directory: ./build
  366. - name: make install
  367. run: make install
  368. working-directory: ./build
  369. external-tests:
  370. runs-on: ubuntu-latest
  371. steps:
  372. - uses: actions/checkout@v4
  373. with:
  374. submodules: recursive
  375. - name: package installs
  376. run: |
  377. sudo apt-get update
  378. 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
  379. - name: install cpanm and Test2::V0 for gost_engine testing
  380. uses: perl-actions/install-with-cpanm@v1
  381. with:
  382. install: Test2::V0
  383. - name: setup hostname workaround
  384. run: sudo hostname localhost
  385. - name: config
  386. 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
  387. - name: make
  388. run: make -s -j4
  389. - name: test external gost-engine
  390. run: make test TESTS="test_external_gost_engine"
  391. - name: test external krb5
  392. run: make test TESTS="test_external_krb5"
  393. - name: test external_tlsfuzzer
  394. run: make test TESTS="test_external_tlsfuzzer"
  395. - name: test external oqs-provider
  396. run: make test TESTS="test_external_oqsprovider"
  397. external-test-pyca:
  398. runs-on: ubuntu-latest
  399. strategy:
  400. matrix:
  401. RUST:
  402. - 1.51.0
  403. PYTHON:
  404. - 3.9
  405. steps:
  406. - uses: actions/checkout@v4
  407. with:
  408. submodules: recursive
  409. - name: Configure OpenSSL
  410. run: ./config --banner=Configured --strict-warnings --debug enable-external-tests && perl configdata.pm --dump
  411. - name: make
  412. run: make -s -j4
  413. - name: Setup Python
  414. uses: actions/setup-python@v4.7.0
  415. with:
  416. python-version: ${{ matrix.PYTHON }}
  417. - uses: actions-rs/toolchain@v1
  418. with:
  419. profile: minimal
  420. toolchain: ${{ matrix.RUST }}
  421. override: true
  422. default: true
  423. - name: test external pyca
  424. run: make test TESTS="test_external_pyca" VERBOSE=1
  425. external-test-cf-quiche:
  426. runs-on: ubuntu-latest
  427. steps:
  428. - uses: actions/checkout@v4
  429. with:
  430. submodules: recursive
  431. - name: Configure OpenSSL
  432. run: ./config --banner=Configured --strict-warnings enable-external-tests && perl configdata.pm --dump
  433. - name: make
  434. run: make -s -j4
  435. - uses: actions-rs/toolchain@v1
  436. with:
  437. profile: default
  438. toolchain: stable
  439. default: true
  440. - name: test external Cloudflare quiche
  441. run: make test TESTS="test_external_cf_quiche" VERBOSE=1