ci.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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@v2
  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@v2
  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@v2
  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@v2
  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@v2
  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@v2
  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@v2
  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@v2
  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@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. address_ub_sanitizer:
  128. runs-on: ubuntu-latest
  129. steps:
  130. - uses: actions/checkout@v2
  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@v2
  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@v2
  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@v2
  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@v2
  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. no-legacy:
  183. runs-on: ubuntu-latest
  184. steps:
  185. - uses: actions/checkout@v2
  186. - name: config
  187. run: ./config --banner=Configured --strict-warnings no-legacy enable-fips enable-quic && perl configdata.pm --dump
  188. - name: make
  189. run: make -s -j4
  190. - name: make test
  191. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  192. legacy:
  193. runs-on: ubuntu-latest
  194. steps:
  195. - uses: actions/checkout@v2
  196. - name: config
  197. 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
  198. - name: make
  199. run: make -s -j4
  200. - name: make test
  201. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  202. enable-tfo:
  203. strategy:
  204. matrix:
  205. os: [ ubuntu-latest, macos-latest ]
  206. runs-on: ${{matrix.os}}
  207. steps:
  208. - uses: actions/checkout@v2
  209. - name: config
  210. run: CC=gcc ./config --banner=Configured enable-tfo enable-quic --strict-warnings && perl configdata.pm --dump
  211. - name: make
  212. run: make -s -j4
  213. - name: make test
  214. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  215. buildtest:
  216. runs-on: ubuntu-latest
  217. steps:
  218. - uses: actions/checkout@v2
  219. - name: config
  220. run: ./config --banner=Configured no-asm no-makedepend enable-buildtest-c++ enable-fips --strict-warnings -D_DEFAULT_SOURCE && perl configdata.pm --dump
  221. - name: make
  222. run: make -s -j4
  223. - name: make test
  224. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  225. out-of-source-and-install:
  226. strategy:
  227. matrix:
  228. os: [ubuntu-latest, macos-latest ]
  229. runs-on: ${{matrix.os}}
  230. steps:
  231. - uses: actions/checkout@v2
  232. - name: extra preparations
  233. run: |
  234. mkdir ./build
  235. mkdir ./install
  236. - name: config
  237. run: ../config --banner=Configured enable-fips enable-acvp-tests --strict-warnings --prefix=$(cd ../install; pwd) && perl configdata.pm --dump
  238. working-directory: ./build
  239. - name: make
  240. run: make -s -j4
  241. working-directory: ./build
  242. - name: make test
  243. run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
  244. working-directory: ./build
  245. - name: make install
  246. run: make install
  247. working-directory: ./build
  248. external-tests:
  249. runs-on: ubuntu-latest
  250. steps:
  251. - uses: actions/checkout@v2
  252. with:
  253. submodules: recursive
  254. - name: package installs
  255. run: |
  256. sudo apt-get update
  257. 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
  258. - name: install cpanm and Test2::V0 for gost_engine testing
  259. uses: perl-actions/install-with-cpanm@v1
  260. with:
  261. install: Test2::V0
  262. - name: setup hostname workaround
  263. run: sudo hostname localhost
  264. - name: config
  265. 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
  266. - name: make
  267. run: make -s -j4
  268. - name: test external gost-engine
  269. run: make test TESTS="test_external_gost_engine"
  270. - name: test external krb5
  271. run: make test TESTS="test_external_krb5"
  272. - name: test external_tlsfuzzer
  273. run: make test TESTS="test_external_tlsfuzzer"
  274. - name: test external oqs-provider
  275. run: make test TESTS="test_external_oqsprovider"
  276. external-test-pyca:
  277. runs-on: ubuntu-latest
  278. strategy:
  279. matrix:
  280. RUST:
  281. - 1.51.0
  282. PYTHON:
  283. - 3.9
  284. steps:
  285. - uses: actions/checkout@v2
  286. with:
  287. submodules: recursive
  288. - name: Configure OpenSSL
  289. run: ./config --banner=Configured --strict-warnings --debug enable-external-tests && perl configdata.pm --dump
  290. - name: make
  291. run: make -s -j4
  292. - name: Setup Python
  293. uses: actions/setup-python@v2.2.2
  294. with:
  295. python-version: ${{ matrix.PYTHON }}
  296. - uses: actions-rs/toolchain@v1
  297. with:
  298. profile: minimal
  299. toolchain: ${{ matrix.RUST }}
  300. override: true
  301. default: true
  302. - name: test external pyca
  303. run: make test TESTS="test_external_pyca" VERBOSE=1