diff --git a/tests/ci/cdk/cdk/codebuild/github_ci_linux_x86_omnibus.yaml b/tests/ci/cdk/cdk/codebuild/github_ci_linux_x86_omnibus.yaml index 7aca32e31f..fcd49421fd 100644 --- a/tests/ci/cdk/cdk/codebuild/github_ci_linux_x86_omnibus.yaml +++ b/tests/ci/cdk/cdk/codebuild/github_ci_linux_x86_omnibus.yaml @@ -380,6 +380,14 @@ batch: compute-type: BUILD_GENERAL1_SMALL image: ECR_REPO_PLACEHOLDER:ubuntu-20.04_clang-9x_latest + - identifier: ubuntu2004_clang7x_x86_64_benchmark + buildspec: ./tests/ci/codebuild/linux-x86/run_bm_build_test.yml + env: + type: LINUX_CONTAINER + privileged-mode: true + compute-type: BUILD_GENERAL1_SMALL + image: ECR_REPO_PLACEHOLDER:ubuntu-20.04_clang-7x-bm-framework_latest + - identifier: ubuntu710_gcc4_1x_x86_64_build buildspec: ./tests/ci/codebuild/linux-x86/run_legacy_build.yml env: diff --git a/tests/ci/codebuild/linux-x86/run_bm_build_test.yml b/tests/ci/codebuild/linux-x86/run_bm_build_test.yml new file mode 100644 index 0000000000..a12d055e47 --- /dev/null +++ b/tests/ci/codebuild/linux-x86/run_bm_build_test.yml @@ -0,0 +1,14 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +version: 0.2 + +phases: + pre_build: + commands: + # To use this build spec file, CMake environment variable CC and CXX compiler should be defined before build. + - if [[ -z "${CC+x}" || -z "${CC}" ]]; then echo "CC is not defined." && exit 1; else ${CC} --version && echo "Found correct CC."; fi + - if [[ -z "${CXX+x}" || -z "${CXX}" ]]; then echo "CXX is not defined." && exit 1; else ${CXX} --version && echo "Found correct CXX."; fi + build: + commands: + - ./tests/ci/run_benchmark_build_tests.sh diff --git a/tests/ci/run_benchmark_build_tests.sh b/tests/ci/run_benchmark_build_tests.sh new file mode 100755 index 0000000000..bc53f9f6b6 --- /dev/null +++ b/tests/ci/run_benchmark_build_tests.sh @@ -0,0 +1,52 @@ +#!/bin/bash -ex +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +source tests/ci/common_posix_setup.sh + +install_dir="$(pwd)/../librypto_install_dir" +openssl_url='https://github.com/openssl/openssl.git' +openssl_1_1_branch='OpenSSL_1_1_1-stable' +openssl_3_0_branch='openssl-3.0' + +function build_openssl_1_1 { + echo "building OpenSSL 1.1" + git clone --branch "${openssl_1_1_branch}" "${openssl_url}" "../openssl-1.1" + pushd "../openssl-1.1" + mkdir -p "${install_dir}/openssl-1.1" + ./config --prefix="${install_dir}/openssl-1.1" --openssldir="${install_dir}/openssl-1.1" + make "-j${NUM_CPU_THREADS}" + make install + popd + rm -rf "../openssl-1.1" +} + +function build_openssl_3_0 { + echo "building OpenSSL 3.0" + git clone --branch "${openssl_3_0_branch}" "${openssl_url}" "../openssl-3.0" + pushd "../openssl-3.0" + mkdir -p "${install_dir}/openssl-3.0" + ./Configure --prefix="${install_dir}/openssl-3.0" --openssldir="${install_dir}/openssl-3.0" + make "-j${NUM_CPU_THREADS}" + make install + popd + rm -rf "../openssl-1.1" +} + +# We build each tool individually so we can have more insight into what is failing + +mkdir -p "${install_dir}" +echo "Testing awslc_bm" +mkdir "${install_dir}/aws_lc" +run_build -DAWSLC_INSTALL_DIR="${install_dir}/aws_lc" +"${BUILD_ROOT}/tool/awslc_bm" + +build_openssl_1_1 +echo "Testing ossl_bm with OpenSSL 1.1" +run_build -DOPENSSL_INSTALL_DIR="${install_dir}/openssl-1.1" +"${BUILD_ROOT}/tool/ossl_bm" + +build_openssl_3_0 +echo "Testing ossl_bm with OpenSSL 3.0" +run_build -DOPENSSL3_INSTALL_DIR="${install_dir}/openssl-3.0" +"${BUILD_ROOT}/tool/ossl3_bm"