-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add libevent to GitHub integration CI (#1615)
### Issues: Resolves CryptoAlg-2465 ### Description of changes: Libevent already works with AWS-LC thanks to other compatibility work. This adds a test to make sure it keeps working. ### Testing: Tested the script locally but need to see what happens with GitHub actions. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license. --------- Co-authored-by: Justin W Smith <103147162+justsmth@users.noreply.github.com>
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
set -exu | ||
|
||
source tests/ci/common_posix_setup.sh | ||
|
||
# Assumes script is executed from the root of aws-lc directory | ||
SCRATCH_FOLDER=${SRC_ROOT}/"scratch" | ||
AWS_LC_BUILD_FOLDER="${SCRATCH_FOLDER}/aws-lc-build" | ||
AWS_LC_INSTALL_FOLDER="${SCRATCH_FOLDER}/aws-lc-install" | ||
LIBEVENT_SRC="${SCRATCH_FOLDER}/libevent" | ||
export LD_LIBRARY_PATH="${AWS_LC_INSTALL_FOLDER}/lib" | ||
|
||
function build_and_test_libevent() { | ||
pushd "${LIBEVENT_SRC}" | ||
mkdir build && pushd build | ||
cmake -GNinja -DOPENSSL_ROOT_DIR="${AWS_LC_INSTALL_FOLDER}" ../ | ||
ninja verify | ||
popd && popd | ||
} | ||
|
||
# Make script execution idempotent. | ||
mkdir -p "${SCRATCH_FOLDER}" | ||
rm -rf "${SCRATCH_FOLDER:?}"/* | ||
pushd "${SCRATCH_FOLDER}" | ||
|
||
mkdir -p "${AWS_LC_BUILD_FOLDER}" "${AWS_LC_INSTALL_FOLDER}" | ||
git clone --depth 1 https://github.com/libevent/libevent.git | ||
|
||
# Test with shared AWS-LC libraries | ||
aws_lc_build "$SRC_ROOT" "$AWS_LC_BUILD_FOLDER" "$AWS_LC_INSTALL_FOLDER" -DBUILD_TESTING=OFF -DBUILD_TOOL=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=1 | ||
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-}:${AWS_LC_INSTALL_FOLDER}/lib/" | ||
build_and_test_libevent | ||
|
||
ldd "${LIBEVENT_SRC}/build/lib/libevent_openssl.so" | grep "${AWS_LC_INSTALL_FOLDER}/lib/libcrypto.so" || exit 1 | ||
popd |