Skip to content

Commit 6db9ace

Browse files
chore: merge Golang/dev branch with mainline (#704)
1 parent 2db84c0 commit 6db9ace

File tree

72 files changed

+20302
-150
lines changed

Some content is hidden

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

72 files changed

+20302
-150
lines changed

.github/actions/install_smithy_dafny_codegen_dependencies/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ runs:
1212
uses: gradle/gradle-build-action@v2
1313
with:
1414
arguments: :codegen-client:pTML :codegen-core:pTML :rust-runtime:pTML
15-
build-root-directory: smithy-dafny/smithy-dafny-codegen-modules/smithy-rs
15+
build-root-directory: mpl/smithy-dafny/smithy-dafny-codegen-modules/smithy-rs
1616

1717
- name: Install smithy-dafny-codegen Python dependencies locally
1818
uses: gradle/gradle-build-action@v2
1919
with:
2020
arguments: :smithy-python-codegen:pTML
21-
build-root-directory: smithy-dafny/codegen/smithy-dafny-codegen-modules/smithy-python/codegen
21+
build-root-directory: mpl/smithy-dafny/codegen/smithy-dafny-codegen-modules/smithy-python/codegen

.github/actions/polymorph_codegen/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ runs:
109109
run: |
110110
make polymorph_dotnet ${{ steps.dependencies.outputs.PROJECT_DEPENDENCIES }}
111111
112+
# TODO: Uncomment when checking in polymorph_rust code
113+
# - name: Regenerate Rust code using smithy-dafny
114+
# working-directory: ./${{ inputs.library }}
115+
# shell: bash
116+
# run: |
117+
# make polymorph_rust ${{ steps.dependencies.outputs.PROJECT_DEPENDENCIES }}
118+
112119
- name: Check regenerated code against commited code
113120
# Composite action inputs seem to not actually support booleans properly for some reason
114121
if: inputs.diff-generated-code == 'true'

.github/workflows/dafny_interop_test_net.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
os: [
3838
windows-latest,
3939
ubuntu-latest,
40-
macos-12,
40+
macos-13,
4141
]
4242
runs-on: ${{ matrix.os }}
4343
permissions:

.github/workflows/dafny_interop_test_vector_net.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
os: [
3737
windows-latest,
3838
ubuntu-latest,
39-
macos-12,
39+
macos-13,
4040
]
4141
runs-on: ${{matrix.os}}
4242
permissions:
@@ -146,7 +146,7 @@ jobs:
146146
matrix:
147147
os: [
148148
ubuntu-latest,
149-
macos-12,
149+
macos-13,
150150
]
151151
runs-on: ${{ matrix.os }}
152152
permissions:
@@ -251,7 +251,7 @@ jobs:
251251
matrix:
252252
os: [
253253
ubuntu-latest,
254-
macos-12,
254+
macos-13,
255255
]
256256
runs-on: ${{ matrix.os }}
257257
permissions:
@@ -267,7 +267,6 @@ jobs:
267267
run: |
268268
git submodule update --init libraries
269269
git submodule update --init --recursive mpl
270-
git submodule update --init smithy-dafny
271270
272271
- name: Configure AWS Credentials
273272
uses: aws-actions/configure-aws-credentials@v4

.github/workflows/daily_ci.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
1212
uses: ./.github/workflows/library_codegen.yml
1313
with:
14-
dafny: '4.8.0'
14+
dafny: '4.8.1'
1515
daily-ci-verification:
1616
# Don't run the cron builds on forks
1717
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
1818
uses: ./.github/workflows/library_dafny_verification.yml
1919
with:
20-
dafny: '4.8.0'
20+
dafny: '4.8.1'
2121
# daily-ci-java:
2222
# if: github.event_name != 'schedule' || github.repository_owner == 'aws'
2323
# uses: ./.github/workflows/library_java_tests.yml
@@ -27,10 +27,15 @@ jobs:
2727
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
2828
uses: ./.github/workflows/library_net_tests.yml
2929
with:
30-
dafny: '4.8.0'
30+
dafny: '4.8.1'
31+
daily-ci-rust:
32+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
33+
uses: ./.github/workflows/library_rust_tests.yml
34+
with:
35+
dafny: '4.8.1'
3136

3237
daily-ci-interop-tests:
3338
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
3439
uses: ./.github/workflows/library_interop_tests.yml
3540
with:
36-
dafny: '4.8.0'
41+
dafny: '4.8.1'

.github/workflows/library_codegen.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
# it to verify the Dafny code. Instead we manually pull the submodules we DO need.
3939
- run: git submodule update --init libraries
4040
- run: git submodule update --init --recursive mpl
41-
- run: git submodule update --init --recursive smithy-dafny
4241

4342
# Only used to format generated code
4443
# and to translate version strings such as "nightly-latest"

.github/workflows/library_dafny_verification.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ jobs:
1919
strategy:
2020
matrix:
2121
library: [
22-
AwsEncryptionSDK
22+
AwsEncryptionSDK,
23+
TestVectors
2324
]
24-
os: [ macos-12 ]
25+
os: [ macos-13 ]
2526
runs-on: ${{ matrix.os }}
2627
env:
2728
DOTNET_CLI_TELEMETRY_OPTOUT: 1
@@ -36,7 +37,13 @@ jobs:
3637
run: |
3738
git submodule update --init libraries
3839
git submodule update --init --recursive mpl
39-
git submodule update --init smithy-dafny
40+
41+
# dafny-reportgenerator requires next6
42+
# but only 7.0 is installed on macos-13-large
43+
- name: Setup .NET Core SDK '6.0.x'
44+
uses: actions/setup-dotnet@v3
45+
with:
46+
dotnet-version: "6.0.x"
4047

4148
- name: Setup Dafny
4249
uses: dafny-lang/[email protected]
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
# This workflow performs interoperability tests across the supported runtimes of the ESDK Dafny
2+
name: Library Interoperability Dafny TestVectors
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
dafny:
8+
description: "The Dafny version to use"
9+
required: true
10+
type: string
11+
regenerate-code:
12+
description: "Regenerate code using smithy-dafny"
13+
required: false
14+
default: false
15+
type: boolean
16+
17+
jobs:
18+
generateEncryptVectors:
19+
strategy:
20+
matrix:
21+
library: [TestVectors]
22+
os: [
23+
# https://taskei.amazon.dev/tasks/CrypTool-5283
24+
# windows-latest,
25+
ubuntu-latest,
26+
macos-13,
27+
]
28+
language: [java, net]
29+
# https://taskei.amazon.dev/tasks/CrypTool-5284
30+
dotnet-version: ["6.0.x"]
31+
runs-on: ${{ matrix.os }}
32+
permissions:
33+
id-token: write
34+
contents: read
35+
36+
steps:
37+
- name: Support longpaths on Git checkout
38+
run: |
39+
git config --global core.longpaths true
40+
41+
- uses: actions/checkout@v3
42+
# Not all submodules are needed.
43+
# We manually pull the submodule we DO need.
44+
- run: git submodule update --init libraries
45+
- run: git submodule update --init --recursive mpl
46+
47+
# Set up runtimes
48+
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
49+
if: matrix.language == 'net'
50+
uses: actions/setup-dotnet@v3
51+
with:
52+
dotnet-version: ${{ matrix.dotnet-version }}
53+
54+
- name: Setup Java 17
55+
if: matrix.language == 'java'
56+
uses: actions/setup-java@v3
57+
with:
58+
distribution: "corretto"
59+
java-version: 17
60+
61+
- name: Setup Dafny
62+
uses: dafny-lang/[email protected]
63+
with:
64+
dafny-version: ${{ inputs.dafny }}
65+
66+
- name: Regenerate code using smithy-dafny if necessary
67+
if: ${{ inputs.regenerate-code }}
68+
uses: ./.github/actions/polymorph_codegen
69+
with:
70+
dafny: ${{ inputs.dafny }}
71+
library: ${{ matrix.library }}
72+
diff-generated-code: false
73+
74+
# Build implementation for each runtime
75+
- name: Build ${{ matrix.library }} implementation in Java
76+
if: matrix.language == 'java'
77+
shell: bash
78+
working-directory: ./${{ matrix.library }}
79+
run: |
80+
# This works because `node` is installed by default on GHA runners
81+
CORES=$(node -e 'console.log(os.cpus().length)')
82+
make build_java CORES=$CORES
83+
84+
- name: Build ${{ matrix.library }} implementation in .NET
85+
if: matrix.language == 'net'
86+
shell: bash
87+
working-directory: ./${{ matrix.library }}
88+
run: |
89+
# This works because `node` is installed by default on GHA runners
90+
CORES=$(node -e 'console.log(os.cpus().length)')
91+
make transpile_net
92+
93+
- name: Setup gradle
94+
if: matrix.language == 'java'
95+
uses: gradle/gradle-build-action@v2
96+
with:
97+
gradle-version: 7.2
98+
99+
# TestVectors will call KMS
100+
- name: Configure AWS Credentials
101+
uses: aws-actions/configure-aws-credentials@v2
102+
with:
103+
aws-region: us-west-2
104+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
105+
role-session-name: InterOpTests
106+
107+
- name: Create Manifests
108+
working-directory: ./${{ matrix.library }}
109+
run: make test_generate_vectors_${{ matrix.language }}
110+
111+
- name: Create Encrypt Manifests
112+
working-directory: ./${{ matrix.library }}
113+
run: make test_encrypt_vectors_${{ matrix.language }}
114+
115+
- name: Upload Encrypt Manifest and keys.json files
116+
uses: actions/upload-artifact@v4
117+
with:
118+
name: ${{matrix.os}}_vector_artifact_${{matrix.language}}_${{github.sha}}
119+
path: |
120+
./${{matrix.library}}/runtimes/${{matrix.language}}/*.json
121+
./${{matrix.library}}/runtimes/${{matrix.language}}/plaintexts
122+
./${{matrix.library}}/runtimes/${{matrix.language}}/ciphertexts
123+
124+
testInteroperablity:
125+
needs: generateEncryptVectors
126+
strategy:
127+
matrix:
128+
library: [TestVectors]
129+
os: [
130+
# https://taskei.amazon.dev/tasks/CrypTool-5283
131+
# windows-latest,
132+
ubuntu-latest,
133+
macos-13,
134+
]
135+
encrypting_language: [java, net]
136+
decrypting_language: [java, net]
137+
# https://taskei.amazon.dev/tasks/CrypTool-5284
138+
dotnet-version: ["6.0.x"]
139+
runs-on: ${{ matrix.os }}
140+
permissions:
141+
id-token: write
142+
contents: read
143+
144+
steps:
145+
- name: Support longpaths on Git checkout
146+
run: |
147+
git config --global core.longpaths true
148+
# TestVectors will call KMS
149+
- name: Configure AWS Credentials
150+
uses: aws-actions/configure-aws-credentials@v2
151+
with:
152+
aws-region: us-west-2
153+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
154+
role-session-name: InterOpTests
155+
156+
- uses: actions/checkout@v3
157+
# Not all submodules are needed.
158+
# We manually pull the submodule we DO need.
159+
- run: git submodule update --init libraries
160+
- run: git submodule update --init --recursive mpl
161+
162+
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
163+
if: matrix.decrypting_language == 'net'
164+
uses: actions/setup-dotnet@v3
165+
with:
166+
dotnet-version: ${{ matrix.dotnet-version }}
167+
168+
- name: Setup Java 17
169+
if: matrix.decrypting_language == 'java'
170+
uses: actions/setup-java@v3
171+
with:
172+
distribution: "corretto"
173+
java-version: 17
174+
175+
- name: Setup Dafny
176+
uses: dafny-lang/[email protected]
177+
with:
178+
dafny-version: ${{ inputs.dafny }}
179+
180+
- name: Regenerate code using smithy-dafny if necessary
181+
if: ${{ inputs.regenerate-code }}
182+
uses: ./.github/actions/polymorph_codegen
183+
with:
184+
dafny: ${{ inputs.dafny }}
185+
library: ${{ matrix.library }}
186+
diff-generated-code: false
187+
188+
# Build implementation for each runtime
189+
- name: Build ${{ matrix.library }} implementation in Java
190+
if: matrix.decrypting_language == 'java'
191+
working-directory: ./${{ matrix.library }}
192+
shell: bash
193+
run: |
194+
# This works because `node` is installed by default on GHA runners
195+
CORES=$(node -e 'console.log(os.cpus().length)')
196+
make build_java CORES=$CORES
197+
198+
- name: Build ${{ matrix.library }} implementation in .NET
199+
if: matrix.decrypting_language == 'net'
200+
working-directory: ./${{ matrix.library }}
201+
shell: bash
202+
run: |
203+
# This works because `node` is installed by default on GHA runners
204+
CORES=$(node -e 'console.log(os.cpus().length)')
205+
make transpile_net
206+
207+
- name: Download Encrypt Manifest Artifact
208+
uses: actions/download-artifact@v4
209+
with:
210+
name: ${{matrix.os}}_vector_artifact_${{matrix.encrypting_language}}_${{github.sha}}
211+
path: ./${{matrix.library}}/runtimes/${{matrix.decrypting_language}}
212+
213+
- name: Decrypt Encrypt Manifest
214+
working-directory: ./${{ matrix.library }}
215+
run: make test_decrypt_encrypt_vectors_${{matrix.decrypting_language}}
216+

0 commit comments

Comments
 (0)