Skip to content

Commit 4f7c54c

Browse files
authored
Merge branch 'main' into robin-aws/fix-nightly-build-2024-10-28
2 parents 31f1b60 + ccf61d6 commit 4f7c54c

File tree

2,355 files changed

+484559
-1508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,355 files changed

+484559
-1508
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ updates:
2020
directory: ".github/workflows"
2121
schedule:
2222
interval: "daily"
23+
- package-ecosystem: "cargo"
24+
directory: "DynamoDbEncryption/runtimes/rust"
25+
schedule:
26+
interval: "daily"

.github/workflows/check-files.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ on:
77

88
jobs:
99
require-approvals:
10-
runs-on: ubuntu-latest
10+
runs-on: ubuntu-22.04
1111
permissions:
1212
issues: write
1313
pull-requests: write
1414
env:
1515
# unfortunately we can't check if the approver is part of the CODEOWNERS. This is a subset of aws/aws-crypto-tools-team
1616
# to add more allowlisted approvers just modify this env variable
17-
maintainers: seebees, texastony, ShubhamChaturvedi7, lucasmcdonald3, josecorella, imabhichow, rishav-karanjit, antonf-amzn, justplaz, ajewellamz
17+
maintainers: seebees, texastony, ShubhamChaturvedi7, lucasmcdonald3, josecorella, imabhichow, rishav-karanjit, antonf-amzn, kessplas, ajewellamz, RitvikKapila
1818
steps:
1919
- uses: actions/checkout@v3
2020
with:

.github/workflows/check_only_key_word.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
grep-only-verification-keyword:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-22.04
1212
permissions:
1313
issues: write
1414
pull-requests: write

.github/workflows/ci_codegen.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
# Note dotnet is only used for formatting generated code
1818
# in this workflow
1919
dotnet-version: ["6.0.x"]
20-
os: [ubuntu-latest]
20+
os: [ubuntu-22.04]
2121
runs-on: ${{ matrix.os }}
2222
defaults:
2323
run:
@@ -39,7 +39,7 @@ jobs:
3939
# and to translate version strings such as "nightly-latest"
4040
# to an actual DAFNY_VERSION.
4141
- name: Setup Dafny
42-
uses: dafny-lang/[email protected]
42+
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
4343
with:
4444
dafny-version: ${{ inputs.dafny }}
4545

@@ -51,6 +51,15 @@ jobs:
5151
- name: Create temporary global.json
5252
run: echo '{"sdk":{"rollForward":"latestFeature","version":"6.0.0"}}' > ./global.json
5353

54+
- name: Setup Java 17 for codegen
55+
uses: actions/setup-java@v4
56+
with:
57+
distribution: "corretto"
58+
java-version: "17"
59+
60+
- name: Install Smithy-Dafny codegen dependencies
61+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
62+
5463
- uses: ./.github/actions/polymorph_codegen
5564
with:
5665
dafny: ${{ inputs.dafny }}

.github/workflows/ci_duvet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
duvet:
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-22.04
1515
steps:
1616
- uses: actions/checkout@v3
1717

.github/workflows/ci_examples_java.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
max-parallel: 1
3030
matrix:
3131
java-version: [8, 11, 16, 17]
32-
os: [macos-12]
32+
os: [macos-13]
3333
runs-on: ${{ matrix.os }}
3434
permissions:
3535
id-token: write
@@ -53,7 +53,7 @@ jobs:
5353
java-version: ${{ matrix.java-version }}
5454

5555
- name: Setup Dafny
56-
uses: dafny-lang/[email protected]
56+
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
5757
with:
5858
dafny-version: ${{ inputs.dafny }}
5959

@@ -71,6 +71,10 @@ jobs:
7171
run: |
7272
sed "s/mplDependencyJavaVersion=.*/mplDependencyJavaVersion=${{inputs.mpl-version}}/g" project.properties > project.properties2; mv project.properties2 project.properties
7373
74+
- name: Install Smithy-Dafny codegen dependencies
75+
if: ${{ inputs.regenerate-code }}
76+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
77+
7478
- name: Regenerate code using smithy-dafny if necessary
7579
if: ${{ inputs.regenerate-code }}
7680
uses: ./.github/actions/polymorph_codegen

.github/workflows/ci_examples_net.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
matrix:
2828
library: [DynamoDbEncryption]
2929
dotnet-version: ["6.0.x"]
30-
os: [macos-12]
30+
os: [macos-13]
3131
runs-on: ${{ matrix.os }}
3232
permissions:
3333
id-token: write
@@ -46,7 +46,7 @@ jobs:
4646
dotnet-version: ${{ matrix.dotnet-version }}
4747

4848
- name: Setup Dafny
49-
uses: dafny-lang/[email protected]
49+
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
5050
with:
5151
dafny-version: ${{ inputs.dafny }}
5252

@@ -59,6 +59,10 @@ jobs:
5959
git submodule update --init --recursive
6060
git rev-parse HEAD
6161
62+
- name: Install Smithy-Dafny codegen dependencies
63+
if: ${{ inputs.regenerate-code }}
64+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
65+
6266
- name: Regenerate code using smithy-dafny if necessary
6367
if: ${{ inputs.regenerate-code }}
6468
uses: ./.github/actions/polymorph_codegen

.github/workflows/ci_static_analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
jobs:
1111
not-grep:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-22.04
1313
steps:
1414
- uses: actions/checkout@v2
1515
- name: not-grep

.github/workflows/ci_test_java.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
matrix:
3030
library: [DynamoDbEncryption]
3131
java-version: [8, 11, 16, 17]
32-
os: [macos-12]
32+
os: [macos-13]
3333
runs-on: ${{ matrix.os }}
3434
permissions:
3535
id-token: write
@@ -47,7 +47,7 @@ jobs:
4747
submodules: recursive
4848

4949
- name: Setup Dafny
50-
uses: dafny-lang/[email protected]
50+
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
5151
with:
5252
dafny-version: ${{ inputs.dafny }}
5353

@@ -65,6 +65,10 @@ jobs:
6565
run: |
6666
sed "s/mplDependencyJavaVersion=.*/mplDependencyJavaVersion=${{inputs.mpl-version}}/g" project.properties > project.properties2; mv project.properties2 project.properties
6767
68+
- name: Install Smithy-Dafny codegen dependencies
69+
if: ${{ inputs.regenerate-code }}
70+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
71+
6872
- name: Regenerate code using smithy-dafny if necessary
6973
if: ${{ inputs.regenerate-code }}
7074
uses: ./.github/actions/polymorph_codegen
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# This workflow is for testing that the latest released version
2+
# of the MPL is compatible with the current DB-ESDK Head
3+
name: Test Latest Released MPL Java with DB-ESDK HEAD
4+
5+
on:
6+
schedule:
7+
- cron: "00 16 * * 1-5"
8+
workflow_dispatch: # allows triggering this manually through the Actions UI
9+
inputs:
10+
run_test_vectors:
11+
description: "Run Test Vectors?"
12+
required: false
13+
default: true
14+
type: boolean
15+
16+
jobs:
17+
getVersion:
18+
# Don't run the cron builds on forks
19+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
20+
uses: ./.github/workflows/dafny_version.yml
21+
getVerifyVersion:
22+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
23+
uses: ./.github/workflows/dafny_verify_version.yml
24+
getMplDependencyJavaVersion:
25+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
26+
uses: ./.github/workflows/mpl_dependency_java_version.yml
27+
testJava:
28+
needs: [getVersion, getMplDependencyJavaVersion]
29+
strategy:
30+
max-parallel: 1
31+
matrix:
32+
java-version: [17]
33+
os: [ubuntu-22.04]
34+
runs-on: ${{ matrix.os }}
35+
permissions:
36+
id-token: write
37+
contents: read
38+
steps:
39+
- name: Configure AWS Credentials
40+
uses: aws-actions/configure-aws-credentials@v4
41+
with:
42+
aws-region: us-west-2
43+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
44+
role-session-name: DDBEC-Dafny-Java-Tests
45+
46+
- uses: actions/checkout@v3
47+
with:
48+
submodules: recursive
49+
50+
- name: Setup Java ${{ matrix.java-version }}
51+
uses: actions/setup-java@v4
52+
with:
53+
distribution: "corretto"
54+
java-version: ${{ matrix.java-version }}
55+
56+
- name: Setup Dafny
57+
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/
58+
with:
59+
dafny-version: ${{ needs.getVersion.outputs.version }}
60+
61+
- name: Install Smithy-Dafny codegen dependencies
62+
if: ${{ inputs.regenerate-code }}
63+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
64+
65+
- name: Regenerate code using smithy-dafny if necessary
66+
if: ${{ inputs.regenerate-code }}
67+
uses: ./.github/actions/polymorph_codegen
68+
with:
69+
dafny: ${{ env.DAFNY_VERSION }}
70+
library: DynamoDbEncryption
71+
diff-generated-code: false
72+
update-and-regenerate-mpl: true
73+
74+
# The following two steps: "Build and deploy to maven local" and "Run Extensive Tests"
75+
# mimic the tests in ./codebuild/staging/release-staging.yml
76+
- name: Build and deploy to maven local
77+
shell: bash
78+
working-directory: ./DynamoDbEncryption
79+
run: |
80+
# Run transpile by itself. We don't want to locally build the MPL because
81+
# we want to verify that the version pulled down from maven works correctly
82+
make transpile_implementation_java
83+
make transpile_test_java
84+
make mvn_local_deploy
85+
make test_java
86+
87+
- name: Run Extensive Tests
88+
working-directory: ./DynamoDbEncryption
89+
run: |
90+
gradle -p runtimes/java clean
91+
gradle -p runtimes/java test
92+
93+
# This makes sure that we are using the correct MPL version to test the DB-ESDK.
94+
# If this contains a SNAPSHOT version, this will fail because'
95+
# we are NOT building the MPL recursively but pulling from Maven.
96+
- name: Update project.properties to use the correct MPL version (from project.properties in DB-ESDK)
97+
working-directory: ./submodules/MaterialProviders/
98+
run: |
99+
sed "s/mplVersion=.*/mplVersion=${{needs.getMplDependencyJavaVersion.outputs.version}}/g" project.properties > project.properties2; mv project.properties2 project.properties
100+
101+
# The following three steps: "Transpile MPL Test Vectors without recursively building the MPL",
102+
# "Run Test Vectors", and "Test Examples" mimic the tests in ./codebuild/staging/validate-staging.yml
103+
- name: Transpile MPL Test Vectors without recursively building the MPL
104+
working-directory: ./submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders
105+
run: |
106+
# Run transpile by itself. We don't want to locally build the MPL because
107+
# we want to verify that the version pulled down from maven works correctly
108+
make transpile_implementation_java
109+
make transpile_test_java
110+
make mvn_local_deploy
111+
112+
- name: Run Test Vectors
113+
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && ${{inputs.run_test_vectors}})
114+
working-directory: ./TestVectors
115+
run: |
116+
# Spin up ddb local
117+
docker run --name dynamodb -d -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -port 8000 -inMemory -cors *
118+
# Run transpile by itself so we don't locally build the MPL.
119+
make transpile_implementation_java
120+
make transpile_test_java
121+
gradle -p runtimes/java runTests
122+
123+
- name: Test Examples
124+
working-directory: ./Examples
125+
run: |
126+
# Run Simple Examples
127+
gradle -p runtimes/java/DynamoDbEncryption test
128+
# Run Migration Examples
129+
gradle -p runtimes/java/Migration/PlaintextToAWSDBE test
130+
gradle -p runtimes/java/Migration/DDBECToAWSDBE test

0 commit comments

Comments
 (0)