Use --debug with no-caching build as sanitizers need it
[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   basic_gcc:
40     runs-on: ubuntu-latest
41     steps:
42     - uses: actions/checkout@v2
43     - name: config
44       run: ./config --strict-warnings && perl configdata.pm --dump
45     - name: make
46       run: make -s -j4
47     - name: make test
48       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
49
50   basic_clang:
51     runs-on: ubuntu-latest
52     steps:
53     - uses: actions/checkout@v2
54     - name: config
55       run: CC=clang ./config --strict-warnings && perl configdata.pm --dump
56     - name: make
57       run: make -s -j4
58     - name: make test
59       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
60
61   minimal:
62     runs-on: ubuntu-latest
63     steps:
64     - uses: actions/checkout@v2
65     - name: config
66       run: ./config --strict-warnings no-bulk no-pic no-asm -DOPENSSL_NO_SECURE_MEMORY -DOPENSSL_SMALL_FOOTPRINT && perl configdata.pm --dump
67     - name: make
68       run: make -s -j4
69     - name: make test
70       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
71
72   no-deprecated:
73     runs-on: ubuntu-latest
74     steps:
75     - uses: actions/checkout@v2
76     - name: config
77       run: ./config --strict-warnings no-deprecated && perl configdata.pm --dump
78     - name: make
79       run: make -s -j4
80     - name: make test
81       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
82
83   non-caching:
84     runs-on: ubuntu-latest
85     steps:
86     - uses: actions/checkout@v2
87     - name: config
88       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
89     - name: make
90       run: make -s -j4
91     - name: make test
92       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]"
93
94   sanitizers:
95     runs-on: ubuntu-latest
96     steps:
97     - uses: actions/checkout@v2
98     - name: config
99       run: ./config --debug enable-asan enable-ubsan enable-rc5 enable-md2 enable-ec_nistp_64_gcc_128 && 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} OPENSSL_TEST_RAND_ORDER=0
104
105   threads_sanitizer:
106     runs-on: ubuntu-latest
107     steps:
108     - uses: actions/checkout@v2
109     - name: config
110       run: CC=clang ./config --strict-warnings -fsanitize=thread && perl configdata.pm --dump
111     - name: make
112       run: make -s -j4
113     - name: make test
114       run: make TESTS=test_threads test HARNESS_JOBS=${HARNESS_JOBS:-4}
115
116   enable_non-default_options:
117     runs-on: ubuntu-latest
118     steps:
119     - uses: actions/checkout@v2
120     - name: config
121       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
122     - name: make
123       run: make -s -j4
124     - name: make test
125       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
126
127   legacy:
128     runs-on: ubuntu-latest
129     steps:
130     - uses: actions/checkout@v2
131     - name: config
132       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
133     - name: make
134       run: make -s -j4
135     - name: make test
136       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
137
138   buildtest:
139     runs-on: ubuntu-latest
140     steps:
141     - uses: actions/checkout@v2
142     - name: config
143       run: ./config no-asm no-makedepend enable-buildtest-c++ --strict-warnings -D_DEFAULT_SOURCE && 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}
148
149   out-of-source-and-install:
150     runs-on: ubuntu-latest
151     steps:
152     - uses: actions/checkout@v2
153     - name: extra preparations
154       run: |
155         mkdir ./build
156         mkdir ./install
157     - name: config
158       run: ../config --strict-warnings --prefix=$(cd ../install; pwd) && perl configdata.pm --dump
159       working-directory: ./build
160     - name: make
161       run: make -s -j4
162       working-directory: ./build
163     - name: make test
164       run: make test HARNESS_JOBS=${HARNESS_JOBS:-4}
165       working-directory: ./build
166     - name: make install
167       run: make install
168       working-directory: ./build
169
170   external-tests:
171     runs-on: ubuntu-latest
172     steps:
173     - uses: actions/checkout@v2
174       with:
175         submodules: recursive
176     - name: package installs
177       run: |
178         sudo apt-get update
179         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
180     - name: install cpanm and Test2::V0 for gost_engine testing
181       uses: perl-actions/install-with-cpanm@v1
182       with:
183         install: Test2::V0
184     - name: config
185       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
186     - name: make
187       run: make -s -j4
188     - name: test external gost-engine
189       run: make test TESTS="test_external_gost_engine"
190     - name: test external krb5
191       run: make test TESTS="test_external_krb5"
192 #   - name: test external boringssl
193 #     run: BORING_RUNNER_DIR=$(pwd)/boringssl/ssl/test/runner make test TESTS="test_external_boringssl"
194 #   - name: test external pyca
195 #     run: make test TESTS="test_external_pyca"