Skip to content

chore(CI): Use Github Actions to start CodeBuild builds #1319

chore(CI): Use Github Actions to start CodeBuild builds

chore(CI): Use Github Actions to start CodeBuild builds #1319

Workflow file for this run

---
name: macOS build and test AWS Encryption SDK for C
on: ["pull_request", "push"]
jobs:
OSX:
runs-on: ${{ matrix.os }}
environment: continuous-integration
strategy:
matrix:
# macos-latest-large is the latest intel based runner
os: [macos-13, macos-latest-large, ubuntu-22.04]
openssl_version: [[email protected]]
permissions:
id-token: write
contents: read
steps:
- name: Install OpenSSL
if: matrix.os != 'ubuntu-22.04'
run: brew install ${{ matrix.openssl_version }}
- name: Install LibCurl
if: matrix.os == 'ubuntu-22.04'
run: sudo apt-get install libcurl4-openssl-dev
- name: Checkout PR
uses: actions/checkout@v4
with:
submodules: recursive
if: ${{ github.repository == 'aws/aws-encryption-sdk-c' }}
- name: Checkout PR with CI bot token
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.CI_BOT_TOKEN }}
if: ${{ github.repository == 'aws/private-aws-encryption-sdk-c-staging' }}
- name: Checkout AWS C++ SDK
uses: actions/checkout@v4
with:
repository: "aws/aws-sdk-cpp"
path: "aws-sdk-cpp"
submodules: recursive
- name: Install dependencies
if: matrix.os != 'ubuntu-22.04'
run:
brew install json-c
- name: Build and install aws-sdk-cpp
if: matrix.os != 'ubuntu-22.04'
run: |
# remove the following line once aws-sdk-cpp fixes linux-shared/SimpleUDP.cpp
perl -i -p -e 's/"-Werror"//' aws-sdk-cpp/cmake/compiler_settings.cmake
mkdir -p build-aws-sdk-cpp || true
mkdir -p install || true
cd build-aws-sdk-cpp
cmake -G Xcode -DTARGET_ARCH="APPLE" -DBUILD_SHARED_LIBS=ON -DBUILD_ONLY="kms" -DENABLE_UNITY_BUILD=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_PREFIX_PATH=${{github.workspace}}/install ../aws-sdk-cpp
xcodebuild -target ALL_BUILD
xcodebuild -target install
- name: Build and install aws-sdk-cpp
if: matrix.os == 'ubuntu-22.04'
run: |
# remove the following line once aws-sdk-cpp fixes linux-shared/SimpleUDP.cpp
perl -i -p -e 's/"-Werror"//' aws-sdk-cpp/cmake/compiler_settings.cmake
mkdir -p build-aws-sdk-cpp || true
mkdir -p install || true
cd build-aws-sdk-cpp
cmake -DBUILD_SHARED_LIBS=ON -DBUILD_ONLY="kms" -DENABLE_UNITY_BUILD=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_PREFIX_PATH=${{github.workspace}}/install ../aws-sdk-cpp
make
make install
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
role-session-name: CESDKTests
- name: Build C-ESDK
if: matrix.os != 'ubuntu-22.04'
env:
OPENSSL_VERSION: ${{ matrix.openssl_version }}
# TODO-RS: Figure out how to safely add AWS credentials and add -DAWS_ENC_SDK_END_TO_END_TESTS=ON and -DAWS_ENC_SDK_KNOWN_GOOD_TESTS=ON
run: |
mkdir build-aws-encryption-sdk-c || true
cd build-aws-encryption-sdk-c
cmake -G Xcode -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_PREFIX_PATH=${{github.workspace}}/install -DOPENSSL_ROOT_DIR="/usr/local/opt/${OPENSSL_VERSION}" ../
xcodebuild -target ALL_BUILD
xcodebuild -scheme RUN_TESTS
- name: Build C-ESDK
if: matrix.os == 'ubuntu-22.04'
env:
OPENSSL_VERSION: ${{ matrix.openssl_version }}
# TODO-RS: Figure out how to safely add AWS credentials and add -DAWS_ENC_SDK_END_TO_END_TESTS=ON and -DAWS_ENC_SDK_KNOWN_GOOD_TESTS=ON
run: |
mkdir build-aws-encryption-sdk-c || true
cd build-aws-encryption-sdk-c
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_PREFIX_PATH=${{github.workspace}}/install -DOPENSSL_ROOT_DIR="/usr/local/opt/${OPENSSL_VERSION}" ../
make
make test
make install
- name: Run Interop Test Vectors
if: matrix.os != 'ubuntu-22.04'
run: |
cd tests/TestVectors/
make decrypt_dafny
make encrypt
make decrypt
- name: Run Interop Test Vectors
if: matrix.os == 'ubuntu-22.04'
run: |
cd tests/TestVectors/
make test_vectors_unix
make decrypt_dafny
make encrypt
make decrypt