Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/scripts/poll_build_status.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Polls the provided CodeBuild batch ID until the build terminates
# Script terminates when the build status is not "IN_PROGRESS".
#
# Usage: ./poll_build_status.sh [batch-build-id]

BUILD_TIMEOUT_MINUTES=120
POLL_COUNTER=0

while [ $POLL_COUNTER -lt $BUILD_TIMEOUT_MINUTES ]; do
BUILD_STATUS=$(aws codebuild batch-get-build-batches \
--ids "$1" \
| jq -r --arg BATCH_ID "$1" '.buildBatches[]
| select(.id == $BATCH_ID)
| .buildBatchStatus' )

echo "Build status is $BUILD_STATUS after $POLL_COUNTER minutes"
# If build succeeds, exit 0; Github will interpret 'exit 0' as successful job run
if [ "$BUILD_STATUS" == "SUCCEEDED" ]; then
exit 0
fi

# If build is not successful nor in-progress, it has either failed, timed-out, faulted, or been stopped.
# Github will interpret 'exit 1' as job failure
if [ "$BUILD_STATUS" != "IN_PROGRESS" ]; then
exit 1
fi

((POLL_COUNTER++))
sleep 60
done

# If job does not report success within BUILD_TIMEOUT_MINUTES, fail Github job
exit 1;
9 changes: 9 additions & 0 deletions .github/scripts/start_codebuild_batch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Starts a CodeBuild batch with provided source version
# Returns build batch ID for build
#
# Usage: ./start_codebuild_batch.sh [source_version]
aws codebuild start-build-batch \
--region us-west-2 \
--project-name AWS-ESDK-Java-CI \
--source-version "$1" \
| jq -r '.buildBatch.id'
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions:
jobs:
staticAnalysis:
name: Static Analysis
environment: ci
runs-on: &codebuild-linux codebuild-CryptoToolsCI-linux-aws-encryption-sdk-java-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- name: Configure AWS Credentials
Expand All @@ -30,6 +31,7 @@ jobs:
image-override: "aws/codebuild/amazonlinux-x86_64-standard:5.0"
vectorTests:
name: Vector Tests
environment: ci
runs-on: *codebuild-linux
strategy:
fail-fast: true
Expand Down Expand Up @@ -60,6 +62,7 @@ jobs:
JAVA_ENV_VERSION: ${{ matrix.platform.distribution }}${{ matrix.version }}
vectorTestsMasterKeyProvider:
name: Vector Tests MasterKeyProvider
environment: ci
runs-on: *codebuild-linux
strategy:
fail-fast: true
Expand Down Expand Up @@ -90,6 +93,7 @@ jobs:
JAVA_ENV_VERSION: ${{ matrix.platform.distribution }}${{ matrix.version }}
netVectorTests:
name: ESDK-NET Vector Tests
environment: ci
runs-on: *codebuild-linux
strategy:
fail-fast: true
Expand Down Expand Up @@ -120,6 +124,7 @@ jobs:
JAVA_ENV_VERSION: ${{ matrix.platform.distribution }}${{ matrix.version }}
generateTestVectors:
name: Generate Vectors
environment: ci
runs-on: *codebuild-linux
strategy:
max-parallel: 1
Expand Down Expand Up @@ -172,6 +177,7 @@ jobs:
--no-transfer-progress
releaseCI:
name: Release CI
environment: ci
runs-on: *codebuild-linux
steps:
- name: Configure AWS Credentials
Expand All @@ -194,6 +200,7 @@ jobs:

validateCI:
name: Validate CI
environment: ci
runs-on: *codebuild-linux
needs: releaseCI
strategy:
Expand Down
89 changes: 89 additions & 0 deletions codebuild/ci/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
version: 0.2

# TODO: Replace/Augment build-graph with build-matrix
# Note: It's possible that 9 builds will be running concurrently with the current arrangement

batch:
fast-fail: false
build-graph:
- identifier: static_analysis
buildspec: codebuild/ci/static-analysis.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
image: aws/codebuild/amazonlinux2-x86_64-standard:3.0
######### Start Vector tests #########
- identifier: vectors_ci_openjdk8
buildspec: codebuild/ci/vectors-ci.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
JAVA_ENV_VERSION: openjdk8
image: aws/codebuild/standard:3.0
- identifier: vectors_ci_openjdk11
buildspec: codebuild/ci/vectors-ci.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
JAVA_ENV_VERSION: openjdk11
image: aws/codebuild/standard:3.0
- identifier: vectors_ci_corretto8
buildspec: codebuild/ci/vectors-ci.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
JAVA_ENV_VERSION: corretto8
image: aws/codebuild/amazonlinux2-x86_64-standard:3.0
- identifier: vectors_ci_corretto11
buildspec: codebuild/ci/vectors-ci.yml
env:
compute-type: BUILD_GENERAL1_LARGE
variables:
JAVA_ENV_VERSION: corretto11
image: aws/codebuild/amazonlinux2-x86_64-standard:3.0
######### End Vector tests #########
- identifier: release_ci
buildspec: codebuild/ci/release-ci.yml
env:
compute-type: BUILD_GENERAL1_LARGE
image: aws/codebuild/standard:3.0
######### Start JAR Smoke tests #########
- identifier: validate_ci_openjdk8
depend-on:
- release_ci
buildspec: codebuild/ci/validate-ci.yml
env:
variables:
JAVA_ENV_VERSION: openjdk8
JAVA_NUMERIC_VERSION: 8
image: aws/codebuild/standard:3.0
- identifier: validate_ci_openjdk11
depend-on:
- release_ci
buildspec: codebuild/ci/validate-ci.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
variables:
JAVA_ENV_VERSION: openjdk11
JAVA_NUMERIC_VERSION: 11
image: aws/codebuild/standard:3.0
- identifier: validate_ci_corretto8
depend-on:
- release_ci
buildspec: codebuild/ci/validate-ci.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
variables:
JAVA_ENV_VERSION: corretto8
JAVA_NUMERIC_VERSION: 8
image: aws/codebuild/amazonlinux2-x86_64-standard:3.0
- identifier: validate_ci_corretto11
depend-on:
- release_ci
buildspec: codebuild/ci/validate-ci.yml
env:
compute-type: BUILD_GENERAL1_MEDIUM
variables:
JAVA_ENV_VERSION: corretto11
JAVA_NUMERIC_VERSION: 11
image: aws/codebuild/amazonlinux2-x86_64-standard:3.0
######### End JAR Smoke tests #########
Loading