1 # Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved.
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
10 on: [pull_request, push]
20 # The platform matrix specifies:
21 # arch: the architecture to build for, this defines the tool-chain
22 # prefix {arch}- and the Debian compiler package gcc-{arch}
24 # libs: the Debian package for the necessary link/runtime libraries.
25 # target: the OpenSSL configuration target to use, this is passed
26 # directly to the config command line.
27 # fips: set to "no" to disable building FIPS, leave unset to
28 # build the FIPS provider.
29 # tests: omit this to run all the tests using QEMU, set it to "none"
30 # to never run the tests, otherwise its value is passed to
31 # the "make test" command to allow selective disabling of
33 # qemucpu: optional; string that describes CPU properties.
34 # The string will be used to set the QEMU_CPU variable.
35 # opensslcapsname: optional; string that describes the postfix of the
36 # OpenSSL environment variable that defines CPU
37 # capabilities. E.g. "foo" will result in an
38 # environment variable with the name OPENSSL_foo.
39 # opensslcaps: optional; if opensslcapsname (see above) is set, then
40 # this string will be used as content for the OpenSSL
41 # capabilities variable.
42 # ppa: Launchpad PPA repository to download packages from.
45 arch: i386-pc-msdosdjgpp,
46 libs: libc-djgpp-dev libwatt-djgpp-dev djgpp-utils,
47 target: no-threads 386 DJGPP,
49 ppa: jwt27/djgpp-toolchain
51 arch: aarch64-linux-gnu,
52 libs: libc6-dev-arm64-cross,
55 arch: alpha-linux-gnu,
56 libs: libc6.1-dev-alpha-cross,
57 target: linux-alpha-gcc
59 arch: arm-linux-gnueabi,
60 libs: libc6-dev-armel-cross,
62 tests: -test_includes -test_store -test_x509_store
64 arch: arm-linux-gnueabihf,
65 libs: libc6-dev-armhf-cross,
67 tests: -test_includes -test_store -test_x509_store
70 libs: libc6-dev-hppa-cross,
71 target: -static linux-generic32,
73 tests: -test_includes -test_store -test_x509_store
76 libs: libc6-dev-m68k-cross,
77 target: -static -m68040 linux-latomic -Wno-stringop-overflow,
79 tests: -test_includes -test_store -test_x509_store
82 libs: libc6-dev-mips-cross,
83 target: -static linux-mips32,
85 tests: -test_includes -test_store -test_x509_store
87 arch: mips64-linux-gnuabi64,
88 libs: libc6-dev-mips64-cross,
89 target: -static linux64-mips64,
92 arch: mipsel-linux-gnu,
93 libs: libc6-dev-mipsel-cross,
95 tests: -test_includes -test_store -test_x509_store
97 arch: powerpc64le-linux-gnu,
98 libs: libc6-dev-ppc64el-cross,
99 # The default compiler for this platform on Ubuntu 20.04 seems
100 # buggy and causes test failures. Dropping the optimisation level
102 target: -O2 linux-ppc64le
104 arch: riscv64-linux-gnu,
105 libs: libc6-dev-riscv64-cross,
106 target: linux64-riscv64
108 arch: s390x-linux-gnu,
109 libs: libc6-dev-s390x-cross,
110 target: linux64-s390x -Wno-stringop-overflow
113 libs: libc6-dev-sh4-cross,
114 target: no-async linux-latomic,
115 tests: -test_includes -test_store -test_x509_store
118 # These build with shared libraries but they crash when run
119 # They mirror static builds above in order to cover more of the
122 arch: hppa-linux-gnu,
123 libs: libc6-dev-hppa-cross,
124 target: linux-generic32,
127 arch: m68k-linux-gnu,
128 libs: libc6-dev-m68k-cross,
129 target: -mcfv4e linux-latomic -Wno-stringop-overflow no-quic,
132 arch: mips-linux-gnu,
133 libs: libc6-dev-mips-cross,
134 target: linux-mips32,
137 arch: mips64-linux-gnuabi64,
138 libs: libc6-dev-mips64-cross,
139 target: linux64-mips64,
143 # This build doesn't execute either with or without shared libraries.
145 arch: sparc64-linux-gnu,
146 libs: libc6-dev-sparc64-cross,
147 target: linux64-sparcv9,
151 runs-on: ubuntu-latest
153 - name: install package repository
154 if: matrix.platform.ppa != ''
156 sudo add-apt-repository ppa:${{ matrix.platform.ppa }}
157 - name: install packages
160 sudo apt-get -yq --force-yes install \
161 gcc-${{ matrix.platform.arch }} \
162 ${{ matrix.platform.libs }}
163 - uses: actions/checkout@v4
164 - name: checkout fuzz/corpora submodule
165 run: git submodule update --init --depth 1 fuzz/corpora
167 - name: config with FIPS
168 if: matrix.platform.fips != 'no'
170 ./config --banner=Configured --strict-warnings enable-fips \
171 --cross-compile-prefix=${{ matrix.platform.arch }}- \
172 ${{ matrix.platform.target }}
173 - name: config without FIPS
174 if: matrix.platform.fips == 'no'
176 ./config --banner=Configured --strict-warnings \
177 --cross-compile-prefix=${{ matrix.platform.arch }}- \
178 ${{ matrix.platform.target }}
180 run: ./configdata.pm --dump
186 if: github.event_name == 'push' && matrix.platform.tests != 'none'
187 run: sudo apt-get -yq --force-yes install qemu-user
189 - name: Set QEMU environment
190 if: github.event_name == 'push' && matrix.platform.qemucpu != ''
191 run: echo "QEMU_CPU=${{ matrix.platform.qemucpu }}" >> $GITHUB_ENV
193 - name: Set OpenSSL caps environment
194 if: github.event_name == 'push' && matrix.platform.opensslcapsname != ''
195 run: echo "OPENSSL_${{ matrix.platform.opensslcapsname }}=\
196 ${{ matrix.platform.opensslcaps }}" >> $GITHUB_ENV
198 - name: make all tests
199 if: github.event_name == 'push' && matrix.platform.tests == ''
201 make test HARNESS_JOBS=${HARNESS_JOBS:-4} \
202 TESTS="-test_afalg" \
203 QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }}
204 - name: make some tests
205 if: github.event_name == 'push' && matrix.platform.tests != 'none' && matrix.platform.tests != ''
207 make test HARNESS_JOBS=${HARNESS_JOBS:-4} \
208 TESTS="${{ matrix.platform.tests }} -test_afalg" \
209 QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }}