2023-09-07 16:59:15 +08:00
# Copyright 2021-2023 The OpenSSL Project Authors. All Rights Reserved.
2021-09-20 07:54:10 +08:00
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
2021-08-30 14:06:49 +08:00
name : Compiler Zoo CI
2023-08-25 19:39:09 +08:00
on : [ push]
2021-08-30 14:06:49 +08:00
2022-07-09 22:03:23 +08:00
permissions :
contents : read
2021-08-30 14:06:49 +08:00
jobs :
compiler :
strategy :
fail-fast : false
matrix :
zoo : [
{
2022-06-23 11:24:32 +08:00
cc : gcc-7,
distro : ubuntu-20.04
2021-08-30 14:06:49 +08:00
}, {
2022-06-23 11:24:32 +08:00
cc : gcc-8,
distro : ubuntu-20.04
2021-08-30 14:06:49 +08:00
}, {
2022-06-23 11:24:32 +08:00
cc : gcc-9,
distro : ubuntu-20.04
2021-08-30 14:06:49 +08:00
}, {
2022-06-23 11:24:32 +08:00
cc : gcc-10,
distro : ubuntu-20.04
2022-06-22 14:20:31 +08:00
}, {
2022-06-23 11:24:32 +08:00
cc : gcc-11,
distro : ubuntu-22.04
2021-08-30 14:06:49 +08:00
}, {
2022-06-23 11:24:32 +08:00
cc : gcc-12,
distro : ubuntu-22.04
2023-04-26 08:04:09 +08:00
}, {
cc : gcc-13,
distro : ubuntu-22.04,
gcc-ppa-name : ubuntu-toolchain-r/test
2021-08-30 14:06:49 +08:00
}, {
2022-06-23 11:24:32 +08:00
cc : clang-6.0,
distro : ubuntu-20.04
2021-08-30 14:06:49 +08:00
}, {
2022-06-23 11:24:32 +08:00
cc : clang-7,
distro : ubuntu-20.04
2021-08-30 14:06:49 +08:00
}, {
2022-06-23 11:24:32 +08:00
cc : clang-8,
distro : ubuntu-20.04
2021-08-30 14:06:49 +08:00
}, {
2022-06-23 11:24:32 +08:00
cc : clang-9,
distro : ubuntu-20.04
2021-08-30 14:06:49 +08:00
}, {
2022-06-23 11:24:32 +08:00
cc : clang-10,
distro : ubuntu-20.04
2021-08-30 14:06:49 +08:00
}, {
2022-06-23 11:24:32 +08:00
cc : clang-11,
distro : ubuntu-20.04
}, {
cc : clang-12,
distro : ubuntu-20.04
}, {
cc : clang-13,
distro : ubuntu-22.04
}, {
cc : clang-14,
distro : ubuntu-22.04
2022-10-20 06:04:25 +08:00
}, {
cc : clang-15,
distro : ubuntu-22.04,
llvm-ppa-name : jammy
2023-02-21 08:37:57 +08:00
}, {
cc : clang-16,
distro : ubuntu-22.04,
llvm-ppa-name : jammy
2023-10-31 19:30:32 +08:00
}, {
cc : clang-17,
distro : ubuntu-22.04,
llvm-ppa-name : jammy
2021-08-30 14:06:49 +08:00
}
]
2022-06-23 11:24:32 +08:00
# We set per-compiler now to allow testing with both older and newer sets
# Often, the full range of oldest->newest compilers we want aren't available
# in a single version of Ubuntu.
runs-on : ${{ matrix.zoo.distro }}
2021-08-30 14:06:49 +08:00
steps :
- name : install packages
run : |
2023-04-26 08:04:09 +08:00
gcc_ppa_name="${{ matrix.zoo.gcc-ppa-name }}"
2022-10-20 06:04:25 +08:00
llvm_ppa_name="${{ matrix.zoo.llvm-ppa-name }}"
2023-04-26 08:04:09 +08:00
# In the Matrix above:
# - we set gcc-ppc-name if the GCC version isn't part of the Ubuntu version we're using (see https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test).
# - we set llvm-ppa-name if an LLVM version isn't part of the Ubuntu version we're using (see https://apt.llvm.org/).
# This is especially needed because even new Ubuntu LTSes aren't available
# until a while after release on Github Actions.
if [[ -n ${gcc_ppa_name} ]] ; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
elif [[ -n ${llvm_ppa_name} ]] ; then
2022-10-20 06:04:25 +08:00
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key |\
gpg --dearmor |\
sudo tee /usr/share/keyrings/llvm-snapshot.gpg.key > /dev/null
clang_version="${{ matrix.zoo.cc }}"
clang_version="${clang_version/clang-}"
echo "deb [signed-by=/usr/share/keyrings/llvm-snapshot.gpg.key] http://apt.llvm.org/${{ matrix.zoo.llvm-ppa-name }}/ llvm-toolchain-${{ matrix.zoo.llvm-ppa-name }}-${clang_version} main" \
| sudo tee /etc/apt/sources.list.d/llvm.list
echo "deb-src [signed-by=/usr/share/keyrings/llvm-snapshot.gpg.key] http://apt.llvm.org/${{ matrix.zoo.llvm-ppa-name }}/ llvm-toolchain-${{ matrix.zoo.llvm-ppa-name }}-${clang_version} main" \
| sudo tee -a /etc/apt/sources.list.d/llvm.list
cat /etc/apt/sources.list.d/llvm.list
fi
2021-08-30 14:06:49 +08:00
sudo apt-get update
2022-10-20 06:04:25 +08:00
sudo apt-get -y install ${{ matrix.zoo.cc }}
2023-09-05 15:56:28 +08:00
- uses : actions/checkout@v4
2023-04-05 19:39:23 +08:00
- name : checkout fuzz/corpora submodule
run : git submodule update --init --depth 1 fuzz/corpora
2021-08-30 14:06:49 +08:00
- name : config
run : |
CC=${{ matrix.zoo.cc }} ./config --banner=Configured no-shared \
-Wall -Werror enable-fips --strict-warnings
- name : config dump
run : ./configdata.pm --dump
- name : make
run : make -s -j4
2023-09-28 16:50:55 +08:00
- name : get cpu info
run : |
cat /proc/cpuinfo
./util/opensslwrap.sh version -c
2021-08-30 14:06:49 +08:00
- name : make test
run : make test HARNESS_JOBS=${HARNESS_JOBS:-4}