re-add pyca/cryptography testing
[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     - uses: actions/checkout@v2
19     - name: config
20       run: ./config --strict-warnings && perl configdata.pm --dump
21     - name: make build_generated
22       run: make -s build_generated
23     - name: make update
24       run: make -s update
25     - name: git diff
26       run: git diff --exit-code
27
28   check_docs:
29     runs-on: ubuntu-latest
30     steps:
31     - uses: actions/checkout@v2
32     - name: config
33       run: ./config --strict-warnings && perl configdata.pm --dump
34     - name: make build_generated
35       run: make -s build_generated
36     - name: make doc-nits
37       run: make doc-nits
38
39   # This checks that we use ANSI C language syntax and semantics.
40   # We are not as strict with libraries, but rather adapt to what's
41   # expected to be available in a certain version of each platform.
42   check-ansi:
43     runs-on: ubuntu-latest
44     steps:
45     - uses: actions/checkout@v2
46     - name: config
47       run: CPPFLAGS=-ansi ./config no-asm no-makedepend enable-buildtest-c++ --strict-warnings -D_DEFAULT_SOURCE && perl configdata.pm --dump
48     - name: make
49       run: make -s -j4
50
51   basic_gcc:
52     runs-on: ubuntu-latest
53     steps:
54     - uses: actions/checkout@v2
55     - name: config
56       run: ./config --strict-warnings && perl configdata.pm --dump
57     - name: make
58       run: make -s -j4
59     - name: make test
60       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
61
62   basic_clang:
63     runs-on: ubuntu-latest
64     steps:
65     - uses: actions/checkout@v2
66     - name: config
67       run: CC=clang ./config --strict-warnings && perl configdata.pm --dump
68     - name: make
69       run: make -s -j4
70     - name: make test
71       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
72
73   minimal:
74     runs-on: ubuntu-latest
75     steps:
76     - uses: actions/checkout@v2
77     - name: config
78       run: ./config --strict-warnings no-bulk no-pic no-asm -DOPENSSL_NO_SECURE_MEMORY -DOPENSSL_SMALL_FOOTPRINT && perl configdata.pm --dump
79     - name: make
80       run: make -s -j4
81     - name: make test
82       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
83
84   no-deprecated:
85     runs-on: ubuntu-latest
86     steps:
87     - uses: actions/checkout@v2
88     - name: config
89       run: ./config --strict-warnings no-deprecated && perl configdata.pm --dump
90     - name: make
91       run: make -s -j4
92     - name: make test
93       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
94
95   no-shared:
96     strategy:
97       matrix:
98         os: [ ubuntu-latest, macos-latest ]
99     runs-on: ${{matrix.os}}
100     steps:
101     - uses: actions/checkout@v2
102     - name: config
103       run: ./config --strict-warnings no-shared && perl configdata.pm --dump
104     - name: make
105       run: make -s -j4
106     - name: make test
107       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
108
109   non-caching:
110     runs-on: ubuntu-latest
111     steps:
112     - uses: actions/checkout@v2
113     - name: config
114       run: ./config --debug enable-asan enable-ubsan no-cached-fetch no-dtls no-tls1 no-tls1-method no-tls1_1 no-tls1_1-method no-async && perl configdata.pm --dump
115     - name: make
116       run: make -s -j4
117     - name: make test
118       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4} OPENSSL_TEST_RAND_ORDER=0 TESTS="-test_fuzz* -test_ssl_* -test_evp -test_cmp_http -test_verify -test_cms -test_store -test_enc -[01][0-9]"
119
120   sanitizers:
121     runs-on: ubuntu-latest
122     steps:
123     - uses: actions/checkout@v2
124     - name: config
125       run: ./config --debug enable-asan enable-ubsan enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 && 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} OPENSSL_TEST_RAND_ORDER=0
130
131   threads_sanitizer:
132     runs-on: ubuntu-latest
133     steps:
134     - uses: actions/checkout@v2
135     - name: config
136       run: CC=clang ./config --strict-warnings -fsanitize=thread && perl configdata.pm --dump
137     - name: make
138       run: make -s -j4
139     - name: make test
140       run: make TESTS=test_threads test HARNESS_JOBS=${HARNESS_JOBS:-4}
141
142   enable_non-default_options:
143     runs-on: ubuntu-latest
144     steps:
145     - uses: actions/checkout@v2
146     - name: config
147       run: ./config --strict-warnings no-ec enable-ssl-trace enable-zlib enable-zlib-dynamic enable-crypto-mdebug enable-crypto-mdebug-backtrace enable-egd && perl configdata.pm --dump
148     - name: make
149       run: make -s -j4
150     - name: make test
151       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
152
153   no-legacy:
154     runs-on: ubuntu-latest
155     steps:
156     - uses: actions/checkout@v2
157     - name: config
158       run: ./config --strict-warnings no-legacy && perl configdata.pm --dump
159     - name: make
160       run: make -s -j4
161     - name: make test
162       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
163
164   legacy:
165     runs-on: ubuntu-latest
166     steps:
167     - uses: actions/checkout@v2
168     - name: config
169       run: ./config -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 && 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   buildtest:
176     runs-on: ubuntu-latest
177     steps:
178     - uses: actions/checkout@v2
179     - name: config
180       run: ./config no-asm no-makedepend enable-buildtest-c++ --strict-warnings -D_DEFAULT_SOURCE && 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   out-of-source-and-install:
187     strategy:
188       matrix:
189         os: [ubuntu-latest, macos-latest ]
190     runs-on: ${{matrix.os}}
191     steps:
192     - uses: actions/checkout@v2
193     - name: extra preparations
194       run: |
195         mkdir ./build
196         mkdir ./install
197     - name: config
198       run: ../config --strict-warnings --prefix=$(cd ../install; pwd) && perl configdata.pm --dump
199       working-directory: ./build
200     - name: make
201       run: make -s -j4
202       working-directory: ./build
203     - name: make test
204       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
205       working-directory: ./build
206     - name: make install
207       run: make install
208       working-directory: ./build
209
210   external-tests:
211     runs-on: ubuntu-latest
212     steps:
213     - uses: actions/checkout@v2
214       with:
215         submodules: recursive
216     - name: package installs
217       run: |
218         sudo apt-get update
219         sudo apt-get -yq install bison dejagnu gettext keyutils ldap-utils libldap2-dev libkeyutils-dev python3 python3-paste python3-pyrad slapd tcl-dev tcl-thread tcsh python3-virtualenv virtualenv
220     - name: install cpanm and Test2::V0 for gost_engine testing
221       uses: perl-actions/install-with-cpanm@v1
222       with:
223         install: Test2::V0
224     - name: setup hostname workaround
225       run: sudo hostname localhost
226     - name: config
227       run: ./config --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 && perl configdata.pm --dump
228     - name: make
229       run: make -s -j4
230     - name: test external gost-engine
231       run: make test TESTS="test_external_gost_engine"
232     - name: test external krb5
233       run: make test TESTS="test_external_krb5"
234
235   external-test-pyca:
236     runs-on: ubuntu-latest
237     strategy:
238       matrix:
239         RUST:
240           - 1.51.0
241         PYTHON:
242           - 3.9
243     steps:
244     - uses: actions/checkout@v2
245       with:
246         submodules: recursive
247     - name: Configure OpenSSL
248       run: ./config --strict-warnings --debug enable-external-tests && perl configdata.pm --dump
249     - name: make
250       run: make -s -j4
251     - name: Setup Python
252       uses: actions/setup-python@v2.2.2
253       with:
254         python-version: ${{ matrix.PYTHON }}
255     - uses: actions-rs/toolchain@v1
256       with:
257         profile: minimal
258         toolchain: ${{ matrix.RUST }}
259         override: true
260         default: true
261     - name: test external pyca
262       run: make test TESTS="test_external_pyca"