ci.yml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
  1. # Copyright 2021-2022 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@v3
  27. with:
  28. fetch-depth: 0
  29. - name: config
  30. run: ./config --banner=Configured --strict-warnings enable-fips enable-quic && 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@v3
  41. - name: config
  42. run: ./config --banner=Configured --strict-warnings enable-fips enable-quic && 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 md-nits
  48. run: |
  49. sudo gem install mdl
  50. make md-nits
  51. # This checks that we use ANSI C language syntax and semantics.
  52. # We are not as strict with libraries, but rather adapt to what's
  53. # expected to be available in a certain version of each platform.
  54. check-ansi:
  55. runs-on: ubuntu-latest
  56. steps:
  57. - uses: actions/checkout@v3
  58. - name: config
  59. run: CPPFLAGS=-ansi ./config --banner=Configured no-asm no-makedepend enable-buildtest-c++ enable-fips enable-quic --strict-warnings -D_DEFAULT_SOURCE && perl configdata.pm --dump
  60. - name: make
  61. run: make -s -j4
  62. basic_gcc:
  63. runs-on: ubuntu-latest
  64. steps:
  65. - uses: actions/checkout@v3
  66. - name: localegen
  67. run: sudo locale-gen tr_TR.UTF-8
  68. - name: config
  69. run: CC=gcc ./config --banner=Configured enable-fips enable-quic --strict-warnings && perl configdata.pm --dump
  70. - name: make
  71. run: make -s -j4
  72. - name: make test
  73. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  74. basic_clang:
  75. runs-on: ubuntu-latest
  76. steps:
  77. - uses: actions/checkout@v3
  78. - name: config
  79. run: CC=clang ./config --banner=Configured no-fips --strict-warnings && perl configdata.pm --dump
  80. - name: make
  81. run: make -s -j4
  82. - name: make test
  83. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  84. minimal:
  85. runs-on: ubuntu-latest
  86. steps:
  87. - uses: actions/checkout@v3
  88. - name: config
  89. run: ./config --banner=Configured --strict-warnings no-bulk no-pic no-asm -DOPENSSL_NO_SECURE_MEMORY -DOPENSSL_SMALL_FOOTPRINT && perl configdata.pm --dump
  90. - name: make
  91. run: make -j4 # verbose, so no -s here
  92. - name: make test
  93. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  94. no-deprecated:
  95. runs-on: ubuntu-latest
  96. steps:
  97. - uses: actions/checkout@v3
  98. - name: config
  99. run: ./config --banner=Configured --strict-warnings no-deprecated enable-fips enable-quic && perl configdata.pm --dump
  100. - name: make
  101. run: make -s -j4
  102. - name: make test
  103. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  104. no-shared:
  105. strategy:
  106. matrix:
  107. os: [ ubuntu-latest, macos-latest ]
  108. runs-on: ${{matrix.os}}
  109. steps:
  110. - uses: actions/checkout@v3
  111. - name: config
  112. run: ./config --banner=Configured --strict-warnings no-shared no-fips && perl configdata.pm --dump
  113. - name: make
  114. run: make -s -j4
  115. - name: make test
  116. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  117. non-caching:
  118. runs-on: ubuntu-latest
  119. steps:
  120. - uses: actions/checkout@v3
  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. address_ub_sanitizer:
  128. runs-on: ubuntu-latest
  129. steps:
  130. - uses: actions/checkout@v3
  131. - name: config
  132. run: ./config --banner=Configured --debug enable-asan enable-ubsan enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 enable-fips enable-quic -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION && perl configdata.pm --dump
  133. - name: make
  134. run: make -s -j4
  135. - name: make test
  136. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
  137. memory_sanitizer:
  138. runs-on: ubuntu-latest
  139. steps:
  140. - uses: actions/checkout@v3
  141. - name: config
  142. # --debug -O1 is to produce a debug build that runs in a reasonable amount of time
  143. 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 enable-quic && perl configdata.pm --dump
  144. - name: make
  145. run: make -s -j4
  146. - name: make test
  147. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
  148. threads_sanitizer:
  149. runs-on: ubuntu-latest
  150. steps:
  151. - uses: actions/checkout@v3
  152. - name: config
  153. run: CC=clang ./config --banner=Configured no-fips --strict-warnings -fsanitize=thread && perl configdata.pm --dump
  154. - name: make
  155. run: make -s -j4
  156. - name: make test
  157. 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 HARNESS_JOBS=${HARNESS_JOBS:-4}
  158. enable_non-default_options:
  159. runs-on: ubuntu-latest
  160. steps:
  161. - uses: actions/checkout@v3
  162. - name: modprobe tls
  163. run: sudo modprobe tls
  164. - name: config
  165. 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 enable-quic && perl configdata.pm --dump
  166. - name: make
  167. run: make -s -j4
  168. - name: make test
  169. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  170. fips_and_ktls:
  171. runs-on: ubuntu-latest
  172. steps:
  173. - uses: actions/checkout@v3
  174. - name: modprobe tls
  175. run: sudo modprobe tls
  176. - name: config
  177. run: ./config --banner=Configured --strict-warnings enable-ktls enable-fips enable-quic && perl configdata.pm --dump
  178. - name: make
  179. run: make -s -j4
  180. - name: make test
  181. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  182. enable_brotli_dynamic:
  183. runs-on: ubuntu-latest
  184. steps:
  185. - name: install brotli
  186. run: |
  187. sudo apt-get update
  188. sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install brotli libbrotli1 libbrotli-dev
  189. - name: checkout openssl
  190. uses: actions/checkout@v3
  191. - name: config
  192. run: ./config enable-comp enable-brotli enable-brotli-dynamic && perl configdata.pm --dump
  193. - name: make
  194. run: make -s -j4
  195. - name: make test
  196. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  197. enable_zstd_dynamic:
  198. runs-on: ubuntu-latest
  199. steps:
  200. - name: install zstd
  201. run: |
  202. sudo apt-get update
  203. sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install zstd libzstd1 libzstd-dev
  204. - name: checkout openssl
  205. uses: actions/checkout@v3
  206. - name: config
  207. run: ./config enable-comp enable-zstd enable-zstd-dynamic && perl configdata.pm --dump
  208. - name: make
  209. run: make -s -j4
  210. - name: make test
  211. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  212. enable_brotli_and_zstd_dynamic:
  213. runs-on: ubuntu-latest
  214. steps:
  215. - name: install brotli and zstd
  216. run: |
  217. sudo apt-get update
  218. sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install brotli libbrotli1 libbrotli-dev
  219. sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install zstd libzstd1 libzstd-dev
  220. - name: checkout openssl
  221. uses: actions/checkout@v3
  222. - name: config
  223. run: ./config enable-comp enable-brotli enable-brotli-dynamic enable-zstd enable-zstd-dynamic && perl configdata.pm --dump
  224. - name: make
  225. run: make -s -j4
  226. - name: make test
  227. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  228. enable_brotli_and_asan_ubsan:
  229. runs-on: ubuntu-latest
  230. steps:
  231. - name: install brotli
  232. run: |
  233. sudo apt-get update
  234. sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install brotli libbrotli1 libbrotli-dev
  235. - name: checkout openssl
  236. uses: actions/checkout@v3
  237. - name: config
  238. run: ./config --banner=Configured --debug enable-asan enable-ubsan enable-comp enable-brotli -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -DPEDANTIC && perl configdata.pm --dump
  239. - name: make
  240. run: make -s -j4
  241. - name: make test
  242. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
  243. enable_zstd_and_asan_ubsan:
  244. runs-on: ubuntu-latest
  245. steps:
  246. - name: install zstd
  247. run: |
  248. sudo apt-get update
  249. sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install zstd libzstd1 libzstd-dev
  250. - name: checkout openssl
  251. uses: actions/checkout@v3
  252. - name: config
  253. run: ./config --banner=Configured --debug enable-asan enable-ubsan enable-comp enable-zstd -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -DPEDANTIC && perl configdata.pm --dump
  254. - name: make
  255. run: make -s -j4
  256. - name: make test
  257. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0
  258. no-legacy:
  259. runs-on: ubuntu-latest
  260. steps:
  261. - uses: actions/checkout@v3
  262. - name: config
  263. run: ./config --banner=Configured --strict-warnings no-legacy enable-fips enable-quic && perl configdata.pm --dump
  264. - name: make
  265. run: make -s -j4
  266. - name: make test
  267. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  268. legacy:
  269. runs-on: ubuntu-latest
  270. steps:
  271. - uses: actions/checkout@v3
  272. - name: config
  273. 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
  274. - name: make
  275. run: make -s -j4
  276. - name: make test
  277. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  278. enable-tfo:
  279. strategy:
  280. matrix:
  281. os: [ ubuntu-latest, macos-latest ]
  282. runs-on: ${{matrix.os}}
  283. steps:
  284. - uses: actions/checkout@v3
  285. - name: config
  286. run: CC=gcc ./config --banner=Configured enable-tfo enable-quic --strict-warnings && perl configdata.pm --dump
  287. - name: make
  288. run: make -s -j4
  289. - name: make test
  290. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  291. buildtest:
  292. runs-on: ubuntu-latest
  293. steps:
  294. - uses: actions/checkout@v3
  295. - name: config
  296. run: ./config --banner=Configured no-asm no-makedepend enable-buildtest-c++ enable-fips --strict-warnings -D_DEFAULT_SOURCE && perl configdata.pm --dump
  297. - name: make
  298. run: make -s -j4
  299. - name: make test
  300. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  301. out-of-source-and-install:
  302. strategy:
  303. matrix:
  304. os: [ubuntu-latest, macos-latest ]
  305. runs-on: ${{matrix.os}}
  306. steps:
  307. - uses: actions/checkout@v3
  308. - name: extra preparations
  309. run: |
  310. mkdir ./build
  311. mkdir ./install
  312. - name: config
  313. run: ../config --banner=Configured enable-fips enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd) && perl configdata.pm --dump
  314. working-directory: ./build
  315. - name: make
  316. run: make -s -j4
  317. working-directory: ./build
  318. - name: make test
  319. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  320. working-directory: ./build
  321. - name: make install
  322. run: make install
  323. working-directory: ./build
  324. external-tests:
  325. runs-on: ubuntu-latest
  326. steps:
  327. - uses: actions/checkout@v3
  328. with:
  329. submodules: recursive
  330. - name: package installs
  331. run: |
  332. sudo apt-get update
  333. 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
  334. - name: install cpanm and Test2::V0 for gost_engine testing
  335. uses: perl-actions/install-with-cpanm@v1
  336. with:
  337. install: Test2::V0
  338. - name: setup hostname workaround
  339. run: sudo hostname localhost
  340. - name: config
  341. 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
  342. - name: make
  343. run: make -s -j4
  344. - name: test external gost-engine
  345. run: make test TESTS="test_external_gost_engine"
  346. - name: test external krb5
  347. run: make test TESTS="test_external_krb5"
  348. - name: test external_tlsfuzzer
  349. run: make test TESTS="test_external_tlsfuzzer"
  350. - name: test external oqs-provider
  351. run: make test TESTS="test_external_oqsprovider"
  352. external-test-pyca:
  353. runs-on: ubuntu-latest
  354. strategy:
  355. matrix:
  356. RUST:
  357. - 1.51.0
  358. PYTHON:
  359. - 3.9
  360. steps:
  361. - uses: actions/checkout@v3
  362. with:
  363. submodules: recursive
  364. - name: Configure OpenSSL
  365. run: ./config --banner=Configured --strict-warnings --debug enable-external-tests && perl configdata.pm --dump
  366. - name: make
  367. run: make -s -j4
  368. - name: Setup Python
  369. uses: actions/setup-python@v4.5.0
  370. with:
  371. python-version: ${{ matrix.PYTHON }}
  372. - uses: actions-rs/toolchain@v1
  373. with:
  374. profile: minimal
  375. toolchain: ${{ matrix.RUST }}
  376. override: true
  377. default: true
  378. - name: test external pyca
  379. run: make test TESTS="test_external_pyca" VERBOSE=1