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