-
Notifications
You must be signed in to change notification settings - Fork 16
chore(GHA): Run Java CI testing for MPL Latest Release #1605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
694f609
chore(GHA): Run Java CI testing for MPL Latest Release
RitvikKapila 9d10120
m
RitvikKapila b048d81
m
RitvikKapila b568644
m
RitvikKapila be6cb89
m
RitvikKapila 6a46b60
m
RitvikKapila 702ac56
m
RitvikKapila ed6ecf1
m
RitvikKapila eb6f8b9
m
RitvikKapila 736e387
m
RitvikKapila 8598979
update
RitvikKapila 00a9456
m
RitvikKapila f71f740
m
RitvikKapila a9627c0
bump mpl; update ci_test_latest_released_mpl_java.yml
RitvikKapila 4ba5139
m
RitvikKapila 0a0a3f7
m
RitvikKapila bf2e657
m
RitvikKapila 9af7f13
m
RitvikKapila 364d8d3
m
RitvikKapila 4c0d7bb
m1
RitvikKapila a990c61
m2
RitvikKapila 5d4f30c
finally
RitvikKapila bac6026
Merge branch 'main' into rkapila/fix-java-release-process
RitvikKapila c04fa3f
add flag to run / not run tvs
RitvikKapila 576e13e
m
RitvikKapila beff849
merge main
RitvikKapila 438730f
try
RitvikKapila 0241874
m
RitvikKapila b024b4e
remove pull_request from workflow
RitvikKapila c62f6bf
Merge branch 'main' into rkapila/fix-java-release-process
RitvikKapila dc74521
Merge branch 'main' into rkapila/fix-java-release-process
RitvikKapila File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,126 @@ | ||
# This workflow is for testing that the latest released version | ||
# of the MPL is compatible with the current DB-ESDK Head | ||
name: Test Latest Released MPL Java with DB-ESDK HEAD | ||
|
||
on: | ||
schedule: | ||
- cron: "00 16 * * 1-5" | ||
workflow_dispatch: # allows triggering this manually through the Actions UI | ||
inputs: | ||
run_test_vectors: | ||
description: "Run Test Vectors?" | ||
required: false | ||
default: true | ||
type: boolean | ||
|
||
jobs: | ||
getVersion: | ||
# Don't run the cron builds on forks | ||
if: github.event_name != 'schedule' || github.repository_owner == 'aws' | ||
uses: ./.github/workflows/dafny_version.yml | ||
getVerifyVersion: | ||
if: github.event_name != 'schedule' || github.repository_owner == 'aws' | ||
uses: ./.github/workflows/dafny_verify_version.yml | ||
getMplDependencyJavaVersion: | ||
if: github.event_name != 'schedule' || github.repository_owner == 'aws' | ||
uses: ./.github/workflows/mpl_dependency_java_version.yml | ||
testJava: | ||
needs: [getVersion, getMplDependencyJavaVersion] | ||
strategy: | ||
max-parallel: 1 | ||
matrix: | ||
java-version: [17] | ||
os: [ubuntu-22.04] | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-region: us-west-2 | ||
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2 | ||
role-session-name: DDBEC-Dafny-Java-Tests | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup Java ${{ matrix.java-version }} | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "corretto" | ||
java-version: ${{ matrix.java-version }} | ||
|
||
- name: Setup Dafny | ||
uses: dafny-lang/[email protected] | ||
with: | ||
dafny-version: ${{ needs.getVersion.outputs.version }} | ||
|
||
- name: Regenerate code using smithy-dafny if necessary | ||
if: ${{ inputs.regenerate-code }} | ||
uses: ./.github/actions/polymorph_codegen | ||
with: | ||
dafny: ${{ env.DAFNY_VERSION }} | ||
library: DynamoDbEncryption | ||
diff-generated-code: false | ||
update-and-regenerate-mpl: true | ||
|
||
# The following two steps: "Build and deploy to maven local" and "Run Extensive Tests" | ||
# mimic the tests in ./codebuild/staging/release-staging.yml | ||
- name: Build and deploy to maven local | ||
shell: bash | ||
working-directory: ./DynamoDbEncryption | ||
run: | | ||
# Run transpile by itself. We don't want to locally build the MPL because | ||
# we want to verify that the version pulled down from maven works correctly | ||
make transpile_implementation_java | ||
make transpile_test_java | ||
make mvn_local_deploy | ||
make test_java | ||
|
||
- name: Run Extensive Tests | ||
working-directory: ./DynamoDbEncryption | ||
run: | | ||
gradle -p runtimes/java clean | ||
gradle -p runtimes/java test | ||
|
||
# This makes sure that we are using the correct MPL version to test the DB-ESDK. | ||
# If this contains a SNAPSHOT version, this will fail because' | ||
# we are NOT building the MPL recursively but pulling from Maven. | ||
- name: Update project.properties to use the correct MPL version (from project.properties in DB-ESDK) | ||
working-directory: ./submodules/MaterialProviders/ | ||
run: | | ||
sed "s/mplVersion=.*/mplVersion=${{needs.getMplDependencyJavaVersion.outputs.version}}/g" project.properties > project.properties2; mv project.properties2 project.properties | ||
josecorella marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# The following three steps: "Transpile MPL Test Vectors without recursively building the MPL", | ||
# "Run Test Vectors", and "Test Examples" mimic the tests in ./codebuild/staging/validate-staging.yml | ||
- name: Transpile MPL Test Vectors without recursively building the MPL | ||
working-directory: ./submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders | ||
run: | | ||
# Run transpile by itself. We don't want to locally build the MPL because | ||
# we want to verify that the version pulled down from maven works correctly | ||
make transpile_implementation_java | ||
make transpile_test_java | ||
make mvn_local_deploy | ||
|
||
- name: Run Test Vectors | ||
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && ${{inputs.run_test_vectors}}) | ||
working-directory: ./TestVectors | ||
run: | | ||
# Spin up ddb local | ||
docker run --name dynamodb -d -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -port 8000 -inMemory -cors * | ||
# Run transpile by itself so we don't locally build the MPL. | ||
make transpile_implementation_java | ||
make transpile_test_java | ||
gradle -p runtimes/java runTests | ||
|
||
- name: Test Examples | ||
working-directory: ./Examples | ||
run: | | ||
# Run Simple Examples | ||
gradle -p runtimes/java/DynamoDbEncryption test | ||
# Run Migration Examples | ||
gradle -p runtimes/java/Migration/PlaintextToAWSDBE test | ||
gradle -p runtimes/java/Migration/DDBECToAWSDBE test |
This file contains hidden or 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 @@ | ||
# This workflow reads the project.properties | ||
# into the environment variables | ||
# and then creates an output variable for `mplDependencyJavaVersion` | ||
name: MPL Dependency Java Version | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
version: | ||
description: "The MPL Dependency Java version from project.properties" | ||
value: ${{ jobs.getMplDependencyJavaVersion.outputs.version }} | ||
|
||
jobs: | ||
getMplDependencyJavaVersion: | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
version: ${{ steps.read_property.outputs.mplDependencyJavaVersion }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Read version from Properties-file | ||
id: read_property | ||
uses: christian-draeger/[email protected] | ||
with: | ||
path: "./project.properties" | ||
properties: "mplDependencyJavaVersion" |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.