Skip to content

Commit be6cb89

Browse files
committed
m
1 parent b568644 commit be6cb89

File tree

6 files changed

+99
-89
lines changed

6 files changed

+99
-89
lines changed

.github/workflows/ci_test_latest_released_mpl_java.yml

Lines changed: 90 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,93 @@ on:
88
workflow_dispatch: # allows triggering this manually through the Actions UI
99

1010
jobs:
11-
getDBESDKDafnyVersion:
12-
# Don't run the cron builds on forks
13-
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
14-
uses: ./.github/workflows/dafny_version.yml
15-
getVerifyDBESDKDafnyVersion:
16-
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
17-
uses: ./.github/workflows/dafny_verify_version.yml
18-
getLatestReleaseMplVersion:
19-
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
20-
uses: ./.github/workflows/mpl_latest_release_version.yml
21-
getMplDafnyVersion:
22-
needs: getLatestReleaseMplVersion
23-
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
24-
uses: ./.github/workflows/mpl_head_version.yml
25-
with:
26-
mpl-head: ${{needs.getLatestReleaseMplVersion.outputs.version}}
27-
test-latest-released-mpl-java:
28-
needs: [getDafnyVersion, getLatestReleaseMplVersion, getMplDafnyVersion]
29-
uses: ./.github/workflows/dafny-interop.yml
30-
with:
31-
mpl-dafny: ${{needs.getLatestReleaseMplVersion.outputs.version}}
32-
mpl-commit: ${{needs.getMplDafnyVersion.outputs.dafnyVersion}}
33-
dbesdk-dafny: ${{needs.getDBESDKDafnyVersion.outputs.version}}
11+
testJava:
12+
strategy:
13+
max-parallel: 1
14+
matrix:
15+
java-version: [8, 11, 16, 17]
16+
os: [macos-13]
17+
runs-on: ${{ matrix.os }}
18+
permissions:
19+
id-token: write
20+
contents: read
21+
steps:
22+
- name: Configure AWS Credentials
23+
uses: aws-actions/configure-aws-credentials@v4
24+
with:
25+
aws-region: us-west-2
26+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
27+
role-session-name: DDBEC-Dafny-Java-Tests
28+
29+
- uses: actions/checkout@v3
30+
with:
31+
submodules: recursive
32+
33+
- name: Setup Java ${{ matrix.java-version }}
34+
uses: actions/setup-java@v4
35+
with:
36+
distribution: "corretto"
37+
java-version: ${{ matrix.java-version }}
38+
39+
- name: Setup Dafny
40+
uses: dafny-lang/[email protected]
41+
with:
42+
dafny-version: ${{ inputs.dafny }}
43+
44+
- name: Regenerate code using smithy-dafny if necessary
45+
if: ${{ inputs.regenerate-code }}
46+
uses: ./.github/actions/polymorph_codegen
47+
with:
48+
dafny: ${{ env.DAFNY_VERSION }}
49+
library: DynamoDbEncryption
50+
diff-generated-code: false
51+
update-and-regenerate-mpl: true
52+
53+
# The following two steps: "Build and deploy to maven local" and "Run Extensive Tests"
54+
# mimic the tests in ./codebuild/staging/release-staging.yml
55+
- name: Build and deploy to maven local
56+
shell: bash
57+
working-directory: ./DynamoDbEncryption
58+
run: |
59+
# Run transpile by itself. We don't want to locally build the MPL because
60+
# we want to verify that the version pulled down from maven works correctly
61+
make transpile_implementation_java
62+
make transpile_test_java
63+
make mvn_local_deploy
64+
make test_java
65+
66+
- name: Run Extensive Tests
67+
working-directory: ./DynamoDbEncryption
68+
run: |
69+
gradle -p runtimes/java clean
70+
gradle -p runtimes/java test
71+
72+
# The following three steps: "Transpile MPL Test Vectors without recursively building the MPL",
73+
# "Run Test Vectors", and "Test Examples" mimic the tests in ./codebuild/staging/release-staging.yml
74+
- name: Transpile MPL Test Vectors without recursively building the MPL
75+
working-directory: ./submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders
76+
run: |
77+
# Run transpile by itself. We don't want to locally build the MPL because
78+
# we want to verify that the version pulled down from maven works correctly
79+
make transpile_implementation_java
80+
make transpile_test_java
81+
make mvn_local_deploy
82+
83+
- name: Run Test Vectors
84+
working-directory: ./TestVectors
85+
run: |
86+
# Spin up ddb local
87+
docker run --name dynamodb -d -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -port 8000 -inMemory -cors *
88+
# Run transpile by itself so we don't locally build the MPL.
89+
make transpile_implementation_java
90+
make transpile_test_java
91+
gradle -p runtimes/java runTests
92+
93+
- name: Test Examples
94+
working-directory: ./Examples
95+
run: |
96+
# Run Simple Examples
97+
gradle -p runtimes/java/DynamoDbEncryption test
98+
# Run Migration Examples
99+
gradle -p runtimes/java/Migration/PlaintextToAWSDBE test
100+
gradle -p runtimes/java/Migration/DDBECToAWSDBE test

.github/workflows/dafny-interop.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,23 @@ jobs:
3131
with:
3232
mpl-dafny: ${{inputs.mpl-dafny}}
3333
mpl-commit: ${{inputs.mpl-commit}}
34-
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
34+
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
3535
dbesdk-dafny: ${{inputs.dbesdk-dafny}}
3636
dafny-interop-java-test-vectors:
3737
needs: getMplHeadVersion
3838
uses: ./.github/workflows/dafny_interop_test_vector_java.yml
3939
with:
4040
mpl-dafny: ${{inputs.mpl-dafny}}
4141
mpl-commit: ${{inputs.mpl-commit}}
42-
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
42+
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
4343
dbesdk-dafny: ${{inputs.dbesdk-dafny}}
4444
dafny-interop-java-examples:
4545
needs: getMplHeadVersion
4646
uses: ./.github/workflows/dafny_interop_examples_java.yml
4747
with:
4848
mpl-dafny: ${{inputs.mpl-dafny}}
4949
mpl-commit: ${{inputs.mpl-commit}}
50-
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
50+
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
5151
dbesdk-dafny: ${{inputs.dbesdk-dafny}}
5252
dafny-interop-net:
5353
uses: ./.github/workflows/dafny_interop_test_net.yml

.github/workflows/mpl-head.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,35 +31,35 @@ jobs:
3131
uses: ./.github/workflows/library_dafny_verification.yml
3232
with:
3333
dafny: ${{needs.getVerifyVersion.outputs.version}}
34-
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
34+
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
3535
mpl-head: true
3636
mpl-head-ci-test-vector-verification:
3737
needs: [getVerifyVersion, getMplHeadVersion]
3838
uses: ./.github/workflows/test_vector_verification.yml
3939
with:
4040
dafny: ${{needs.getVerifyVersion.outputs.version}}
41-
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
41+
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
4242
mpl-head: true
4343
mpl-head-ci-java:
4444
needs: [getVersion, getMplHeadVersion]
4545
uses: ./.github/workflows/ci_test_java.yml
4646
with:
4747
dafny: ${{needs.getVersion.outputs.version}}
48-
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
48+
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
4949
mpl-head: true
5050
mpl-head-ci-java-test-vectors:
5151
needs: [getVersion, getMplHeadVersion]
5252
uses: ./.github/workflows/ci_test_vector_java.yml
5353
with:
5454
dafny: ${{needs.getVersion.outputs.version}}
55-
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
55+
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
5656
mpl-head: true
5757
mpl-head-ci-java-examples:
5858
needs: [getVersion, getMplHeadVersion]
5959
uses: ./.github/workflows/ci_examples_java.yml
6060
with:
6161
dafny: ${{needs.getVersion.outputs.version}}
62-
mpl-version: ${{needs.getMplHeadVersion.outputs.mplVersion}}
62+
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
6363
mpl-head: true
6464
mpl-head-ci-net:
6565
needs: getVersion

.github/workflows/mpl_head_version.yml

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,9 @@ on:
1212
default: main
1313
type: string
1414
outputs:
15-
mplVersion:
15+
version:
1616
description: "The MPL version"
1717
value: ${{ jobs.getMplHeadVersion.outputs.version }}
18-
dafnyVersion:
19-
description: "The dafny version for the MPL"
20-
value: ${{ jobs.getMplHeadDafnyVersion.outputs.version }}
2118

2219
jobs:
2320
getMplHeadVersion:
@@ -43,27 +40,3 @@ jobs:
4340
with:
4441
path: "submodules/MaterialProviders/project.properties"
4542
properties: "mplVersion"
46-
47-
getMplHeadDafnyVersion:
48-
runs-on: ubuntu-22.04
49-
outputs:
50-
version: ${{ steps.read_property.outputs.dafnyVersion }}
51-
steps:
52-
- uses: actions/checkout@v4
53-
with:
54-
submodules: recursive
55-
fetch-depth: 0
56-
- name: Update MPL submodule locally if requested
57-
working-directory: submodules/MaterialProviders
58-
shell: bash
59-
run: |
60-
git checkout ${{inputs.mpl-head}}
61-
git submodule update --init --recursive
62-
git rev-parse HEAD
63-
64-
- name: Get the MPL version from the MPL submodule
65-
id: read_property
66-
uses: christian-draeger/[email protected]
67-
with:
68-
path: "submodules/MaterialProviders/project.properties"
69-
properties: "dafnyVersion"

.github/workflows/mpl_latest_release_version.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

project.properties

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,3 @@ dafnyVersion=4.9.0
44
dafnyVerifyVersion=4.9.0
55
dafnyRuntimeJavaVersion=4.9.0
66
smithyDafnyJavaConversionVersion=0.1.1
7-
# mplDependencyJavaLatestReleaseVersionTag is used in ci_test_latest_released_mpl_java.yml
8-
# to test whether the HEAD of DB_ESDK is compatible with the latest released version of
9-
# the MPL or not.
10-
# Add here the tag of the latest released MPL version, for instance, v1.8.0
11-
mplDependencyJavaLatestReleaseVersionTag="v1.8.0"

0 commit comments

Comments
 (0)