Skip to content
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

chore(GHA): Run Java CI testing for MPL Latest Release #1605

Merged
merged 31 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
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
32 changes: 32 additions & 0 deletions .github/workflows/ci_test_latest_released_mpl_java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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"
josecorella marked this conversation as resolved.
Show resolved Hide resolved

jobs:
getDBESDKDafnyVersion:
# Don't run the cron builds on forks
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/dafny_version.yml
getVerifyDBESDKDafnyVersion:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/dafny_verify_version.yml
getLatestReleaseMplVersion:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/mpl_latest_release_version.yml
getMplDafnyVersion:
needs: getLatestReleaseMplVersion
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/mpl_head_version.yml
with:
mpl-head: ${{needs.getLatestReleaseMplVersion.outputs.version}}
test-latest-released-mpl-java:
needs: [getDafnyVersion, getLatestReleaseMplVersion, getMplDafnyVersion]
uses: ./.github/workflows/dafny-interop.yml
with:
mpl-dafny: ${{needs.getLatestReleaseMplVersion.outputs.version}}
mpl-commit: ${{needs.getMplDafnyVersion.outputs.dafnyVersion}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't make sense, why for the mpl commit are we supplying the dafny version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the MPL version will be built with its own Dafny version, and we pick this up from the project properties file of the MPL.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look at the first input to dafny-interop.yml.

dbesdk-dafny: ${{needs.getDBESDKDafnyVersion.outputs.version}}
6 changes: 3 additions & 3 deletions .github/workflows/dafny-interop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ jobs:
with:
mpl-dafny: ${{inputs.mpl-dafny}}
mpl-commit: ${{inputs.mpl-commit}}
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
dbesdk-dafny: ${{inputs.dbesdk-dafny}}
dafny-interop-java-test-vectors:
needs: getMplHeadVersion
uses: ./.github/workflows/dafny_interop_test_vector_java.yml
with:
mpl-dafny: ${{inputs.mpl-dafny}}
mpl-commit: ${{inputs.mpl-commit}}
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
dbesdk-dafny: ${{inputs.dbesdk-dafny}}
dafny-interop-java-examples:
needs: getMplHeadVersion
uses: ./.github/workflows/dafny_interop_examples_java.yml
with:
mpl-dafny: ${{inputs.mpl-dafny}}
mpl-commit: ${{inputs.mpl-commit}}
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
dbesdk-dafny: ${{inputs.dbesdk-dafny}}
dafny-interop-net:
uses: ./.github/workflows/dafny_interop_test_net.yml
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/mpl-head.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,35 @@ jobs:
uses: ./.github/workflows/library_dafny_verification.yml
with:
dafny: ${{needs.getVerifyVersion.outputs.version}}
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
mpl-head: true
mpl-head-ci-test-vector-verification:
needs: [getVerifyVersion, getMplHeadVersion]
uses: ./.github/workflows/test_vector_verification.yml
with:
dafny: ${{needs.getVerifyVersion.outputs.version}}
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
mpl-head: true
mpl-head-ci-java:
needs: [getVersion, getMplHeadVersion]
uses: ./.github/workflows/ci_test_java.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
mpl-head: true
mpl-head-ci-java-test-vectors:
needs: [getVersion, getMplHeadVersion]
uses: ./.github/workflows/ci_test_vector_java.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
mpl-head: true
mpl-head-ci-java-examples:
needs: [getVersion, getMplHeadVersion]
uses: ./.github/workflows/ci_examples_java.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
mpl-head: true
mpl-head-ci-net:
needs: getVersion
Expand Down
31 changes: 29 additions & 2 deletions .github/workflows/mpl_head_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ on:
default: main
type: string
outputs:
version:
description: "The dafny version for verify"
mplVersion:
description: "The MPL version"
value: ${{ jobs.getMplHeadVersion.outputs.version }}
dafnyVersion:
description: "The dafny version for the MPL"
value: ${{ jobs.getMplHeadDafnyVersion.outputs.version }}

jobs:
getMplHeadVersion:
Expand All @@ -40,3 +43,27 @@ jobs:
with:
path: "submodules/MaterialProviders/project.properties"
properties: "mplVersion"

getMplHeadDafnyVersion:
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.read_property.outputs.dafnyVersion }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Update MPL submodule locally if requested
working-directory: submodules/MaterialProviders
shell: bash
run: |
git checkout ${{inputs.mpl-head}}
git submodule update --init --recursive
git rev-parse HEAD

- name: Get the MPL version from the MPL submodule
id: read_property
uses: christian-draeger/[email protected]
with:
path: "submodules/MaterialProviders/project.properties"
properties: "dafnyVersion"
25 changes: 25 additions & 0 deletions .github/workflows/mpl_latest_release_version.yml
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 `mplDependencyJavaLatestReleaseVersionTag`
name: Latest Released MPL Version

on:
workflow_call:
outputs:
version:
description: "The latest released MPL version"
value: ${{ jobs.getMPLVersion.outputs.version }}

jobs:
getMPLVersion:
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.read_property.outputs.mplDependencyJavaLatestReleaseVersionTag }}
steps:
- uses: actions/checkout@v4
- name: Read version from Properties-file
id: read_property
uses: christian-draeger/[email protected]
with:
path: "./project.properties"
properties: "mplDependencyJavaLatestReleaseVersionTag"
2 changes: 0 additions & 2 deletions codebuild/staging/release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ phases:
- aws sts get-caller-identity
build:
commands:
# Validate the MPL submodule points to the correct release
- scripts/validate-mpl-submodule.sh
# Build and deploy to maven local
- cd DynamoDbEncryption/
- make transpile_implementation_java
Expand Down
5 changes: 5 additions & 0 deletions project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ dafnyVersion=4.9.0
dafnyVerifyVersion=4.9.0
dafnyRuntimeJavaVersion=4.9.0
smithyDafnyJavaConversionVersion=0.1.1
# mplDependencyJavaLatestReleaseVersionTag is used in ci_test_latest_released_mpl_java.yml
# to test whether the HEAD of DB_ESDK is compatible with the latest released version of
# the MPL or not.
# Add here the tag of the latest released MPL version, for instance, v1.8.0
mplDependencyJavaLatestReleaseVersionTag="v1.8.0"
Loading