Skip to content
Merged
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
36 changes: 28 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
# image: "aws/codebuild/amazonlinux-x86_64-standard:5.0"
- distribution: corretto
image: "aws/codebuild/amazonlinux-x86_64-standard:5.0" # Corretto only runs on AL2
version: [ 8, 11 ]
version: [ 8, 11, 17, 21 ]
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
# image: "aws/codebuild/standard:3.0"
- distribution: corretto
image: "aws/codebuild/amazonlinux-x86_64-standard:5.0" # Corretto only runs on AL2
version: [ 8, 11 ]
version: [ 8, 11, 17, 21 ]
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
# image: "aws/codebuild/standard:3.0"
- distribution: corretto
image: "aws/codebuild/amazonlinux-x86_64-standard:5.0" # Corretto only runs on AL2
version: [ 8, 11 ]
version: [ 8, 11, 17, 21 ]
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
# image: "aws/codebuild/standard:3.0"
- distribution: corretto
image: "aws/codebuild/amazonlinux-x86_64-standard:5.0" # Corretto only runs on AL2
version: [ 8, 11 ]
version: [ 8, 11, 17, 21 ]
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand All @@ -149,6 +149,27 @@ jobs:
env-vars-for-codebuild: JAVA_ENV_VERSION
env:
JAVA_ENV_VERSION: ${{ matrix.platform.distribution }}${{ matrix.version }}
validateConsumerCompiles:
name: Validate Consumer Smoke Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java-version: [ 8, 11, 17, 21 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: corretto
java-version: ${{ matrix.java-version }}
- name: Compile and run smoke test against Maven Central
working-directory: codebuild/ci/validate-consumer
run: |
mvn compile exec:java \
-Dexec.mainClass="validate.EsdkSmokeTest" \
-Desdk.version=3.0.1 \
-Djava.version=${{ matrix.java-version }} \
--no-transfer-progress
releaseCI:
name: Release CI
runs-on: ubuntu-latest
Expand All @@ -170,6 +191,7 @@ jobs:
env-vars-for-codebuild: GITHUB_EVENT_NAME
env:
GITHUB_EVENT_NAME: $GITHUB_EVENT_NAME

validateCI:
name: Validate CI
runs-on: ubuntu-latest
Expand All @@ -178,11 +200,9 @@ jobs:
fail-fast: true
matrix:
platform:
# - distribution: openjdk
# image: "aws/codebuild/standard:3.0"
- distribution: corretto
image: "aws/codebuild/amazonlinux-x86_64-standard:5.0" # Corretto only runs on AL2
version: [ 8, 11 ]
image: "aws/codebuild/amazonlinux-x86_64-standard:5.0"
version: [ 8, 11, 17, 21 ]
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand Down
11 changes: 4 additions & 7 deletions codebuild/ci/validate-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,18 @@ phases:
commands:
- VERSION_HASH="$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)-$CODEBUILD_RESOLVED_SOURCE_VERSION-$GITHUB_EVENT_NAME"
- export SETTINGS_FILE=$(pwd)/codebuild/ci/settings.xml
- git clone https://github.com/aws-samples/busy-engineers-document-bucket.git
- cd busy-engineers-document-bucket/exercises/java/encryption-context-complete
- cd codebuild/ci/validate-consumer
- export CODEARTIFACT_TOKEN=$(aws codeartifact get-authorization-token --domain $DOMAIN --domain-owner $ACCOUNT --query authorizationToken --output text --region ${REGION})
- export CODEARTIFACT_REPO_URL=https://${DOMAIN}-${ACCOUNT}.d.codeartifact.${REGION}.amazonaws.com/maven/${REPOSITORY}
build:
commands:
- |
mvn verify \
mvn compile exec:java \
-Dexec.mainClass="validate.EsdkSmokeTest" \
-Pcodeartifact \
-Dcheckstyle.skip \
-Desdk.version=$VERSION_HASH \
-Dmaven.compiler.target=$JAVA_NUMERIC_VERSION \
-Dmaven.compiler.source=$JAVA_NUMERIC_VERSION \
-Djava.version=$JAVA_NUMERIC_VERSION \
-Dcodeartifact.token=$CODEARTIFACT_TOKEN \
-Dcodeartifact.url=$CODEARTIFACT_REPO_URL \
--no-transfer-progress \
-T 4 \
-s $SETTINGS_FILE
39 changes: 39 additions & 0 deletions codebuild/ci/validate-consumer/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.amazonaws.esdk</groupId>
<artifactId>validate-consumer</artifactId>
<version>1.0-SNAPSHOT</version>
<description>Smoke test that the ESDK artifact is resolvable and compiles</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<java.version>8</java.version>
<esdk.version>LATEST</esdk.version>
</properties>

<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-encryption-sdk-java</artifactId>
<version>${esdk.version}</version>
</dependency>
</dependencies>

<profiles>
<profile>
<id>codeartifact</id>
<repositories>
<repository>
<id>codeartifact</id>
<url>${codeartifact.url}</url>
</repository>
</repositories>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package validate;

import com.amazonaws.encryptionsdk.AwsCrypto;
import com.amazonaws.encryptionsdk.CommitmentPolicy;
import com.amazonaws.encryptionsdk.CryptoResult;
import com.amazonaws.encryptionsdk.MasterKeyProvider;
import com.amazonaws.encryptionsdk.jce.JceMasterKey;

/**
* Smoke test that the published ESDK artifact is resolvable
* and that key public API classes are importable and usable.
*/
public class EsdkSmokeTest {
public static void main(String[] args) {
AwsCrypto crypto = AwsCrypto.builder()
.withCommitmentPolicy(CommitmentPolicy.RequireEncryptRequireDecrypt)
.build();
System.out.println("ESDK artifact resolved and AwsCrypto instantiated successfully.");
System.out.println("AwsCrypto version info: " + crypto.toString());
}
}
2 changes: 1 addition & 1 deletion codebuild/ci/vectors-generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ phases:
runtime-versions:
java: $JAVA_ENV_VERSION
commands:
- n 16
- n 22
# Install the Javascript ESDK run test vectors
- npm install -g @aws-crypto/integration-node

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<version>0.8.12</version>
<executions>
<execution>
<goals>
Expand Down
Loading