forked from aws/aws-lc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CMake GitHub Actions CI (aws#1367)
- Loading branch information
Showing
5 changed files
with
122 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
FROM amazonlinux:2023 | ||
|
||
ARG CMAKE_VERSION | ||
ARG CMAKE_DOWNLOAD_URL | ||
ARG CMAKE_SHA256 | ||
|
||
VOLUME ["/awslc"] | ||
|
||
RUN dnf install -y tar ninja-build golang gcc gcc-c++ libcurl-devel libarchive-devel zlib-devel xz-devel | ||
|
||
RUN mkdir /cmake | ||
|
||
COPY cmake_build.sh / | ||
COPY awslc_build.sh / | ||
COPY entry.sh / | ||
|
||
WORKDIR /cmake | ||
|
||
RUN curl -L -o source.tar.gz "${CMAKE_DOWNLOAD_URL}" && \ | ||
echo "${CMAKE_SHA256} source.tar.gz" | sha256sum -c - && \ | ||
mkdir source && \ | ||
tar -x -f source.tar.gz -v --strip-components=1 -C source | ||
|
||
WORKDIR /cmake/source | ||
|
||
RUN /cmake_build.sh | ||
|
||
WORKDIR / | ||
|
||
ENTRYPOINT ["/entry.sh"] |
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,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
set -ex -o pipefail | ||
|
||
echo "Building with CMake Version: $(cmake --version)" | ||
|
||
BUILD_DIR=$(mktemp -d) | ||
SRC_DIR="${SRC_DIR:-/awslc}" | ||
CMAKE_CONFIGURE_ARGS=("${argv[@]}") | ||
|
||
pushd "${BUILD_DIR}" | ||
|
||
cmake "${SRC_DIR}" "${CMAKE_CONFIGURE_ARGS[@]}" | ||
cmake --build . | ||
|
||
"${BUILD_DIR}/crypto/crypto_test" | ||
|
||
if [[ -a "${BUILD_DIR}/ssl/ssl_test" ]]; then | ||
"${BUILD_DIR}/ssl/ssl_test" | ||
fi | ||
|
||
popd # ${BUILD_DIR} |
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,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
set -ex -o pipefail | ||
|
||
echo "Building CMake Version: ${CMAKE_VERSION:-unknown}" | ||
|
||
# At the moment this works fine for all versions, in the future build logic can be modified to | ||
# look at it ${CMAKE_VERSION}. | ||
./configure --prefix=/opt/cmake --system-curl --system-libarchive | ||
make | ||
make install |
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,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 OR ISC | ||
|
||
set -ex -o pipefail | ||
|
||
export PATH="/opt/cmake/bin:${PATH}" | ||
|
||
/awslc_build.sh "${argv[@]}" |
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,40 @@ | ||
name: AWS-LC CMake Compatability | ||
on: | ||
pull_request: | ||
branches: [ '*' ] | ||
push: | ||
branches: [ '*' ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | ||
cancel-in-progress: true | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
GOPROXY: https://proxy.golang.org,direct | ||
jobs: | ||
cmake: | ||
name: CMake Version Build | ||
strategy: | ||
matrix: | ||
cmake: | ||
- { version: "3.2", url: "https://cmake.org/files/v3.2/cmake-3.2.3.tar.gz", hash: "a1ebcaf6d288eb4c966714ea457e3b9677cdfde78820d0f088712d7320850297" } | ||
- { version: "3.28", url: "https://cmake.org/files/v3.28/cmake-3.28.1.tar.gz", hash: "15e94f83e647f7d620a140a7a5da76349fc47a1bfed66d0f5cdee8e7344079ad" } | ||
generator: | ||
- "Unix Makefiles" | ||
- "Ninja" | ||
fips: | ||
- 0 | ||
- 1 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build Docker Image | ||
working-directory: .github/docker_images/cmake_build_versions | ||
run: | | ||
docker build -t "cmake-${{ matrix.cmake.version }}" --build-arg CMAKE_VERSION=${{ matrix.cmake.version }} --build-arg CMAKE_DOWNLOAD_URL=${{ matrix.cmake.url }} --build-arg CMAKE_SHA256=${{ matrix.cmake.hash }} . | ||
- name: ${{ matrix.generator }} (Static) | ||
run: | | ||
docker run -v "${{ github.workspace }}:/awslc" "cmake-${{ matrix.cmake.version }}" -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 -DFIPS=${{ matrix.fips }} | ||
- name: ${{ matrix.generator }} (Shared) | ||
run: | | ||
docker run -v "${{ github.workspace }}:/awslc" "cmake-${{ matrix.cmake.version }}" -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=1 -DFIPS=${{ matrix.fips }} |