Skip to content

Commit 155cf9c

Browse files
Merge branch 'main' into rishav/removeMacOS
2 parents 73085fd + d988c6e commit 155cf9c

File tree

2,147 files changed

+363592
-190333
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,147 files changed

+363592
-190333
lines changed

.github/workflows/check-files.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ 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

.github/workflows/check_only_key_word.yml

+1-1
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

+2-2
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:
@@ -52,7 +52,7 @@ jobs:
5252
run: echo '{"sdk":{"rollForward":"latestFeature","version":"6.0.0"}}' > ./global.json
5353

5454
- name: Setup Java 17 for codegen
55-
uses: actions/setup-java@v3
55+
uses: actions/setup-java@v4
5656
with:
5757
distribution: "corretto"
5858
java-version: "17"

.github/workflows/ci_duvet.yml

+1-1
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_static_analysis.yml

+1-1
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
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: dafny-lang/[email protected]
58+
with:
59+
dafny-version: ${{ needs.getVersion.outputs.version }}
60+
61+
- name: Regenerate code using smithy-dafny if necessary
62+
if: ${{ inputs.regenerate-code }}
63+
uses: ./.github/actions/polymorph_codegen
64+
with:
65+
dafny: ${{ env.DAFNY_VERSION }}
66+
library: DynamoDbEncryption
67+
diff-generated-code: false
68+
update-and-regenerate-mpl: true
69+
70+
# The following two steps: "Build and deploy to maven local" and "Run Extensive Tests"
71+
# mimic the tests in ./codebuild/staging/release-staging.yml
72+
- name: Build and deploy to maven local
73+
shell: bash
74+
working-directory: ./DynamoDbEncryption
75+
run: |
76+
# Run transpile by itself. We don't want to locally build the MPL because
77+
# we want to verify that the version pulled down from maven works correctly
78+
make transpile_implementation_java
79+
make transpile_test_java
80+
make mvn_local_deploy
81+
make test_java
82+
83+
- name: Run Extensive Tests
84+
working-directory: ./DynamoDbEncryption
85+
run: |
86+
gradle -p runtimes/java clean
87+
gradle -p runtimes/java test
88+
89+
# This makes sure that we are using the correct MPL version to test the DB-ESDK.
90+
# If this contains a SNAPSHOT version, this will fail because'
91+
# we are NOT building the MPL recursively but pulling from Maven.
92+
- name: Update project.properties to use the correct MPL version (from project.properties in DB-ESDK)
93+
working-directory: ./submodules/MaterialProviders/
94+
run: |
95+
sed "s/mplVersion=.*/mplVersion=${{needs.getMplDependencyJavaVersion.outputs.version}}/g" project.properties > project.properties2; mv project.properties2 project.properties
96+
97+
# The following three steps: "Transpile MPL Test Vectors without recursively building the MPL",
98+
# "Run Test Vectors", and "Test Examples" mimic the tests in ./codebuild/staging/validate-staging.yml
99+
- name: Transpile MPL Test Vectors without recursively building the MPL
100+
working-directory: ./submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders
101+
run: |
102+
# Run transpile by itself. We don't want to locally build the MPL because
103+
# we want to verify that the version pulled down from maven works correctly
104+
make transpile_implementation_java
105+
make transpile_test_java
106+
make mvn_local_deploy
107+
108+
- name: Run Test Vectors
109+
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && ${{inputs.run_test_vectors}})
110+
working-directory: ./TestVectors
111+
run: |
112+
# Spin up ddb local
113+
docker run --name dynamodb -d -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -port 8000 -inMemory -cors *
114+
# Run transpile by itself so we don't locally build the MPL.
115+
make transpile_implementation_java
116+
make transpile_test_java
117+
gradle -p runtimes/java runTests
118+
119+
- name: Test Examples
120+
working-directory: ./Examples
121+
run: |
122+
# Run Simple Examples
123+
gradle -p runtimes/java/DynamoDbEncryption test
124+
# Run Migration Examples
125+
gradle -p runtimes/java/Migration/PlaintextToAWSDBE test
126+
gradle -p runtimes/java/Migration/DDBECToAWSDBE test

.github/workflows/ci_test_vector_net.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
dotnet-version: ["6.0.x"]
2828
os: [
2929
# Run on ubuntu image that comes pre-configured with docker
30-
ubuntu-latest,
30+
ubuntu-22.04,
3131
]
3232
runs-on: ${{ matrix.os }}
3333
permissions:
@@ -89,7 +89,7 @@ jobs:
8989
- name: Test TestVectors on .NET 6.0
9090
working-directory: ./${{matrix.library}}/runtimes/net
9191
run: |
92-
cp ../java/decrypt_java_*.json ../java/decrypt_dotnet_*.json .
92+
cp ../java/decrypt_java_*.json ../java/decrypt_dotnet_*.json ../java/decrypt_rust_*.json .
9393
dotnet run
9494
cp ../java/*.json .
9595
dotnet run --framework net6.0

.github/workflows/ci_todos.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
shell: bash
1818
# TODOs may be committed as long as the same line contains a link to a Github Issue or refers to a CrypTool SIM.
1919
run: |
20-
ALL_TODO_COUNT=$( { grep -r "TODO" . --exclude-dir=./TestVectors/runtimes --exclude-dir=./submodules --exclude-dir=./.git --exclude=./.github/workflows/ci_todos.yml || true; } | wc -l)
21-
GOOD_TODO_COUNT=$( { grep -r "TODO.*\(github.com\/.*issues.*\/[1-9][0-9]*\|CrypTool-[1-9][0-9]*\)" . --exclude-dir=./submodules --exclude-dir=./.git --exclude-dir=./TestVectors/runtimes --exclude=./.github/workflows/ci_todos.yml || true; } | wc -l)
20+
ALL_TODO_COUNT=$( { grep -r "TODO" . --exclude-dir=./releases --exclude-dir=./TestVectors/runtimes --exclude-dir=./submodules --exclude-dir=./.git --exclude=./.github/workflows/ci_todos.yml || true; } | wc -l)
21+
GOOD_TODO_COUNT=$( { grep -r "TODO.*\(github.com\/.*issues.*\/[1-9][0-9]*\|CrypTool-[1-9][0-9]*\)" . --exclude-dir=./releases --exclude-dir=./submodules --exclude-dir=./.git --exclude-dir=./TestVectors/runtimes --exclude=./.github/workflows/ci_todos.yml || true; } | wc -l)
2222
if [ "$ALL_TODO_COUNT" != "$GOOD_TODO_COUNT" ]; then
2323
exit 1;
2424
fi

.github/workflows/dafny_interop_examples_java.yml

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ jobs:
6060
run: |
6161
git fetch
6262
git checkout ${{inputs.mpl-commit}}
63-
git pull
6463
git submodule update --init --recursive
6564
git rev-parse HEAD
6665

.github/workflows/dafny_interop_examples_net.yml

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ jobs:
6060
run: |
6161
git fetch
6262
git checkout ${{inputs.mpl-commit}}
63-
git pull
6463
git submodule update --init --recursive
6564
git rev-parse HEAD
6665

.github/workflows/dafny_interop_java.yml

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ jobs:
6060
run: |
6161
git fetch
6262
git checkout ${{inputs.mpl-commit}}
63-
git pull
6463
git submodule update --init --recursive
6564
git rev-parse HEAD
6665

.github/workflows/dafny_interop_test_net.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
matrix:
2525
library: [DynamoDbEncryption]
2626
dotnet-version: ["6.0.x"]
27-
os: [macos-13, ubuntu-latest, windows-latest]
27+
os: [macos-13, ubuntu-22.04, windows-latest]
2828
runs-on: ${{ matrix.os }}
2929
permissions:
3030
id-token: write
@@ -56,7 +56,6 @@ jobs:
5656
run: |
5757
git fetch
5858
git checkout ${{inputs.mpl-commit}}
59-
git pull
6059
git submodule update --init --recursive
6160
git rev-parse HEAD
6261

.github/workflows/dafny_interop_test_vector_java.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
java-version: [8, 11, 16, 17]
3131
os: [
3232
# Run on ubuntu image that comes pre-configured with docker
33-
ubuntu-latest,
33+
ubuntu-22.04,
3434
]
3535
runs-on: ${{ matrix.os }}
3636
permissions:
@@ -65,7 +65,6 @@ jobs:
6565
run: |
6666
git fetch
6767
git checkout ${{inputs.mpl-commit}}
68-
git pull
6968
git submodule update --init --recursive
7069
git rev-parse HEAD
7170

.github/workflows/dafny_interop_test_vector_net.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
matrix:
2525
library: [TestVectors]
2626
dotnet-version: ["6.0.x"]
27-
os: [ubuntu-latest]
27+
os: [ubuntu-22.04]
2828
runs-on: ${{ matrix.os }}
2929
permissions:
3030
id-token: write
@@ -61,7 +61,6 @@ jobs:
6161
run: |
6262
git fetch
6363
git checkout ${{inputs.mpl-commit}}
64-
git pull
6564
git submodule update --init --recursive
6665
git rev-parse HEAD
6766
@@ -109,7 +108,7 @@ jobs:
109108
- name: Test TestVectors on .NET 6.0
110109
working-directory: ./${{matrix.library}}/runtimes/net
111110
run: |
112-
cp ../java/decrypt_java_*.json ../java/decrypt_dotnet_*.json .
111+
cp ../java/decrypt_java_*.json ../java/decrypt_dotnet_*.json ../java/decrypt_rust_*.json .
113112
dotnet run
114113
cp ../java/*.json .
115114
dotnet run --framework net6.0

.github/workflows/dafny_verify_version.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
getDafnyVerifyVersion:
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-22.04
1616
outputs:
1717
version: ${{ steps.read_property.outputs.dafnyVerifyVersion }}
1818
steps:

.github/workflows/dafny_version.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
getDafnyVersion:
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-22.04
1616
outputs:
1717
version: ${{ steps.read_property.outputs.dafnyVersion }}
1818
steps:

.github/workflows/library_rust_tests.yml

+22-17
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,19 @@ jobs:
4141
id-token: write
4242
contents: read
4343
env:
44-
RUST_MIN_STACK: 404857600
44+
RUST_MIN_STACK: 838860800
4545
steps:
46+
- name: Setup Docker
47+
if: matrix.os == 'macos-13' && matrix.library == 'TestVectors'
48+
uses: douglascamata/setup-docker-macos-action@v1-alpha
49+
50+
- name: Setup DynamoDB Local
51+
if: matrix.library == 'TestVectors'
52+
uses: rrainn/[email protected]
53+
with:
54+
port: 8000
55+
cors: "*"
56+
4657
- name: Support longpaths on Git checkout
4758
run: |
4859
git config --global core.longpaths true
@@ -64,14 +75,11 @@ jobs:
6475
uses: actions-rust-lang/[email protected]
6576
with:
6677
components: rustfmt
67-
# uncomment this after Rust formatter works
68-
# - name: Rustfmt Check
69-
# uses: actions-rust-lang/rustfmt@v1
7078

7179
- name: Setup Dafny
72-
uses: dafny-lang/setup-dafny-action@v1.7.0
80+
uses: dafny-lang/setup-dafny-action@v1.8.0
7381
with:
74-
dafny-version: nightly-2024-12-03-4954170
82+
dafny-version: nightly-2025-01-30-7db1e5f
7583

7684
- name: Update MPL submodule if using MPL HEAD
7785
if: ${{ inputs.mpl-head == true }}
@@ -82,18 +90,8 @@ jobs:
8290
git submodule update --init --recursive
8391
git rev-parse HEAD
8492
85-
# Remove this after the formatting in Rust starts working
86-
- name: smithy-dafny Rust hacks
87-
shell: bash
88-
run: |
89-
if [ "$RUNNER_OS" == "macOS" ]; then
90-
sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' submodules/smithy-dafny/SmithyDafnyMakefile.mk
91-
else
92-
sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' submodules/smithy-dafny/SmithyDafnyMakefile.mk
93-
fi
94-
9593
- name: Setup Java 17 for codegen
96-
uses: actions/setup-java@v3
94+
uses: actions/setup-java@v4
9795
with:
9896
distribution: "corretto"
9997
java-version: "17"
@@ -132,6 +130,13 @@ jobs:
132130
run: |
133131
make test_rust
134132
133+
- name: Test ${{ matrix.library }} Rust Debug
134+
if: ${{ matrix.library != 'TestVectors' }}
135+
shell: bash
136+
working-directory: ./${{ matrix.library }}
137+
run: |
138+
make test_rust test_rust_debug
139+
135140
- name: Test Examples for Rust in ${{ matrix.library }}
136141
if: ${{ matrix.library == 'DynamoDbEncryption' }}
137142
working-directory: ./${{ matrix.library }}/runtimes/rust/

0 commit comments

Comments
 (0)