@@ -25,13 +25,17 @@ jobs:
25
25
ubuntu-22.04,
26
26
macos-13,
27
27
]
28
- language : [java, net, rust, go]
28
+ language : [java, net, rust, go, python ]
29
29
# https://taskei.amazon.dev/tasks/CrypTool-5284
30
30
dotnet-version : ["6.0.x"]
31
31
runs-on : ${{ matrix.os }}
32
32
permissions :
33
33
id-token : write
34
- contents : read
34
+ contents : read
35
+ steps :
36
+ - name : Support longpaths on Git checkout
37
+ run : |
38
+ git config --global core.longpaths true
35
39
36
40
# TestVectors will call KMS
37
41
- name : Configure AWS Credentials
83
87
# uses: actions-rust-lang/rustfmt@v1
84
88
85
89
# TODO: Remove this after the formatting in Rust starts working
90
+ - name : Setup Go
91
+ uses : actions/setup-go@v5
92
+ with :
93
+ go-version : " 1.23"
94
+
95
+ - name : Install Go imports
96
+ run : |
97
+ go install golang.org/x/tools/cmd/goimports@latest
98
+
86
99
- name : smithy-dafny Rust hacks
87
100
if : matrix.language == 'rust'
88
101
shell : bash
@@ -157,6 +170,23 @@ jobs:
157
170
# This works because `node` is installed by default on GHA runners
158
171
CORES=$(node -e 'console.log(os.cpus().length)')
159
172
make transpile_python CORES=$CORES
173
+
174
+ - name : Build ${{ matrix.library }} implementation in Go
175
+ if : matrix.language == 'go'
176
+ shell : bash
177
+ working-directory : ./${{ matrix.library }}
178
+ run : |
179
+ # This works because `node` is installed by default on GHA runners
180
+ CORES=$(node -e 'console.log(os.cpus().length)')
181
+ make transpile_go
182
+
183
+ # TODO: Remove this after Go polymorph does not generate unwanted duplicate code.
184
+ - name : Purge polymorph code in Go
185
+ if : matrix.language == 'go'
186
+ shell : bash
187
+ working-directory : ./${{ matrix.library }}
188
+ run : |
189
+ make purge_polymorph_code
160
190
161
191
- name : Setup gradle
162
192
if : matrix.language == 'java'
@@ -193,8 +223,8 @@ jobs:
193
223
ubuntu-latest,
194
224
macos-13,
195
225
]
196
- encrypting_language : [java, net, rust, python]
197
- decrypting_language : [java, net, rust, python]
226
+ encrypting_language : [java, net, rust, go, python]
227
+ decrypting_language : [java, net, rust, go, python]
198
228
# https://taskei.amazon.dev/tasks/CrypTool-5284
199
229
dotnet-version : ["6.0.x"]
200
230
runs-on : ${{ matrix.os }}
@@ -212,180 +242,9 @@ jobs:
212
242
uses : aws-actions/configure-aws-credentials@v2
213
243
with :
214
244
aws-region : us-west-2
215
- role-to-assume : arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
245
+ role-to-assume : arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
216
246
role-session-name : InterOpTests
217
-
218
- - uses : actions/checkout@v3
219
- # Not all submodules are needed.
220
- # We manually pull the submodule we DO need.
221
- - run : git submodule update --init libraries
222
- - run : git submodule update --init --recursive mpl
223
-
224
- # Set up runtimes
225
- - name : Setup .NET Core SDK ${{ matrix.dotnet-version }}
226
- if : matrix.language == 'net'
227
- uses : actions/setup-dotnet@v3
228
- with :
229
- dotnet-version : ${{ matrix.dotnet-version }}
230
-
231
- # Setup Java in Rust is needed for running polymorph
232
- - name : Setup Java 17
233
- if : matrix.language == 'java' || matrix.language == 'rust'
234
- uses : actions/setup-java@v3
235
- with :
236
- distribution : " corretto"
237
- java-version : 17
238
-
239
- - name : Setup Rust Toolchain for GitHub CI
240
- if : matrix.language == 'rust'
241
- uses :
actions-rust-lang/[email protected]
242
- with :
243
- components : rustfmt
244
-
245
- - name : Setup Go
246
- uses : actions/setup-go@v5
247
- with :
248
- go-version : " 1.23"
249
-
250
- - name : Install Go imports
251
- run : |
252
- go install golang.org/x/tools/cmd/goimports@latest
253
-
254
- - name : Setup NASM for Windows in Rust (aws-lc-sys)
255
- if : matrix.language == 'rust' && matrix.os == 'windows-latest'
256
- uses : ilammy/setup-nasm@v1
257
-
258
- - name : Setup Dafny Rust
259
- if : matrix.language == 'rust'
260
- uses :
dafny-lang/[email protected]
261
- with :
262
- dafny-version : nightly-2025-01-30-7db1e5f
263
-
264
- - name : Setup Dafny Not Rust
265
- if : matrix.language != 'rust'
266
- uses :
dafny-lang/[email protected]
267
- with :
268
- dafny-version : ${{ inputs.dafny }}
269
-
270
- - name : Regenerate code using smithy-dafny if necessary
271
- if : ${{ inputs.regenerate-code }}
272
- uses : ./.github/actions/polymorph_codegen
273
- with :
274
- dafny : ${{ inputs.dafny }}
275
- library : ${{ matrix.library }}
276
- diff-generated-code : false
277
-
278
- # Build implementation for each runtime
279
- - name : Build ${{ matrix.library }} implementation in Java
280
- if : matrix.language == 'java'
281
- shell : bash
282
- working-directory : ./${{ matrix.library }}
283
- run : |
284
- # This works because `node` is installed by default on GHA runners
285
- CORES=$(node -e 'console.log(os.cpus().length)')
286
- make build_java CORES=$CORES
287
-
288
- - name : Build ${{ matrix.library }} implementation in .NET
289
- if : matrix.language == 'net'
290
- shell : bash
291
- working-directory : ./${{ matrix.library }}
292
- run : |
293
- # This works because `node` is installed by default on GHA runners
294
- CORES=$(node -e 'console.log(os.cpus().length)')
295
- make transpile_net
296
-
297
- - name : Install Smithy-Dafny codegen dependencies
298
- if : matrix.language == 'rust'
299
- uses : ./.github/actions/install_smithy_dafny_codegen_dependencies
300
-
301
- - name : Run make polymorph_rust
302
- if : matrix.language == 'rust'
303
- shell : bash
304
- working-directory : ./${{ matrix.library }}
305
- run : |
306
- make polymorph_rust
307
-
308
- - name : Build ${{ matrix.library }} implementation in Rust
309
- if : matrix.language == 'rust'
310
- shell : bash
311
- working-directory : ./${{ matrix.library }}
312
- run : |
313
- CORES=$(node -e 'console.log(os.cpus().length)')
314
- make transpile_rust CORES=$CORES
315
-
316
- - name : Build ${{ matrix.library }} implementation in Go
317
- if : matrix.language == 'go'
318
- shell : bash
319
- working-directory : ./${{ matrix.library }}
320
- run : |
321
- # This works because `node` is installed by default on GHA runners
322
- CORES=$(node -e 'console.log(os.cpus().length)')
323
- make transpile_go
324
-
325
- # TODO: Remove this after Go polymorph does not generate unwanted duplicate code.
326
- - name : Purge polymorph code in Go
327
- if : matrix.language == 'go'
328
- shell : bash
329
- working-directory : ./${{ matrix.library }}
330
- run : |
331
- make purge_polymorph_code
332
-
333
- - name : Setup gradle
334
- if : matrix.language == 'java'
335
- uses : gradle/gradle-build-action@v2
336
- with :
337
- gradle-version : 7.2
338
-
339
- - name : Create Manifests
340
- working-directory : ./${{ matrix.library }}
341
- run : make test_generate_vectors_${{ matrix.language }}
342
-
343
- - name : Create Encrypt Manifests
344
- working-directory : ./${{ matrix.library }}
345
- run : make test_encrypt_vectors_${{ matrix.language }}
346
-
347
- - name : Upload Encrypt Manifest and keys.json files
348
- uses : actions/upload-artifact@v4
349
- with :
350
- name : ${{matrix.os}}_vector_artifact_${{matrix.language}}_${{github.sha}}
351
- path : |
352
- ./${{matrix.library}}/runtimes/${{matrix.language}}/*.json
353
- ./${{matrix.library}}/runtimes/${{matrix.language}}/plaintexts
354
- ./${{matrix.library}}/runtimes/${{matrix.language}}/ciphertexts
355
-
356
- testInteroperablity :
357
- needs : generateEncryptVectors
358
- strategy :
359
- matrix :
360
- library : [TestVectors]
361
- os : [
362
- # https://taskei.amazon.dev/tasks/CrypTool-5283
363
- # windows-latest,
364
- ubuntu-22.04,
365
- macos-13,
366
- ]
367
- encrypting_language : [java, net, rust, go]
368
- decrypting_language : [java, net, rust, go]
369
- # https://taskei.amazon.dev/tasks/CrypTool-5284
370
- dotnet-version : ["6.0.x"]
371
- runs-on : ${{ matrix.os }}
372
- permissions :
373
- id-token : write
374
- contents : read
375
-
376
- steps :
377
- - name : Support longpaths on Git checkout
378
- run : |
379
- git config --global core.longpaths true
380
-
381
- # TestVectors will call KMS
382
- - name : Configure AWS Credentials
383
- uses : aws-actions/configure-aws-credentials@v2
384
- with :
385
- aws-region : us-west-2
386
- role-to-assume : arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
387
- role-session-name : InterOpTests
388
-
247
+
389
248
- uses : actions/checkout@v3
390
249
# Not all submodules are needed.
391
250
# We manually pull the submodule we DO need.
@@ -423,29 +282,27 @@ jobs:
423
282
uses :
actions-rust-lang/[email protected]
424
283
with :
425
284
components : rustfmt
285
+ # TODO - uncomment this after Rust formatter works
286
+ # - name: Rustfmt Check
287
+ # uses: actions-rust-lang/rustfmt@v1
426
288
427
- - name : Setup Go
428
- uses : actions/setup-go@v5
429
- with :
430
- go-version : " 1.23"
431
-
432
- - name : Install Go imports
289
+ # TODO: Remove this after the formatting in Rust starts working
290
+ - name : smithy-dafny Rust hacks
291
+ if : matrix.decrypting_language == 'rust'
292
+ shell : bash
433
293
run : |
434
- go install golang.org/x/tools/cmd/goimports@latest
294
+ if [ "$RUNNER_OS" == "macOS" ]; then
295
+ sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
296
+ else
297
+ sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
298
+ fi
435
299
436
300
- name : Setup NASM for Windows in Rust (aws-lc-sys)
437
301
if : matrix.decrypting_language == 'rust' && matrix.os == 'windows-latest'
438
302
uses : ilammy/setup-nasm@v1
439
303
440
- - name : Setup Dafny Rust
441
- if : matrix.decrypting_language == 'rust'
442
- uses :
dafny-lang/[email protected]
443
- with :
444
- dafny-version : nightly-2025-01-30-7db1e5f
445
-
446
- - name : Setup Dafny Not Rust
447
- if : matrix.decrypting_language != 'rust'
448
- uses :
dafny-lang/[email protected]
304
+ - name : Setup Dafny
305
+ uses :
dafny-lang/[email protected]
449
306
with :
450
307
dafny-version : ${{ inputs.dafny }}
451
308
@@ -479,7 +336,8 @@ jobs:
479
336
- name : Install Smithy-Dafny codegen dependencies
480
337
if : matrix.decrypting_language == 'rust'
481
338
uses : ./.github/actions/install_smithy_dafny_codegen_dependencies
482
-
339
+
340
+ # TODO: Remove this after checking in Rust polymorph code
483
341
- name : Run make polymorph_rust
484
342
if : matrix.decrypting_language == 'rust'
485
343
shell : bash
@@ -494,8 +352,7 @@ jobs:
494
352
run : |
495
353
CORES=$(node -e 'console.log(os.cpus().length)')
496
354
make transpile_rust CORES=$CORES
497
-
498
- <<<<<<< HEAD
355
+
499
356
- name : Build ${{ matrix.library }} implementation in Go
500
357
if : matrix.decrypting_language == 'go'
501
358
shell : bash
@@ -512,15 +369,14 @@ jobs:
512
369
working-directory : ./${{ matrix.library }}
513
370
run : |
514
371
make purge_polymorph_code
515
- =======
372
+
516
373
- name : Build ${{ matrix.library }} implementation in Python
517
374
if : matrix.decrypting_language == 'python'
518
375
shell : bash
519
376
working-directory : ./${{ matrix.library }}
520
377
run : |
521
378
CORES=$(node -e 'console.log(os.cpus().length)')
522
379
make transpile_python CORES=$CORES
523
- >>>>>>> a812a13f (m)
524
380
525
381
- name : Download Encrypt Manifest Artifact
526
382
uses : actions/download-artifact@v4
0 commit comments