@@ -33,6 +33,174 @@ jobs:
33
33
id-token : write
34
34
contents : read
35
35
36
+ # TestVectors will call KMS
37
+ - name : Configure AWS Credentials
38
+ uses : aws-actions/configure-aws-credentials@v2
39
+ with :
40
+ aws-region : us-west-2
41
+ role-to-assume : arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
42
+ role-session-name : InterOpTests
43
+
44
+ - uses : actions/checkout@v3
45
+ # Not all submodules are needed.
46
+ # We manually pull the submodule we DO need.
47
+ - run : git submodule update --init libraries
48
+ - run : git submodule update --init --recursive mpl
49
+
50
+ # Set up runtimes
51
+ - name : Setup .NET Core SDK ${{ matrix.dotnet-version }}
52
+ if : matrix.language == 'net'
53
+ uses : actions/setup-dotnet@v3
54
+ with :
55
+ dotnet-version : ${{ matrix.dotnet-version }}
56
+
57
+ # Setup Java in Rust is needed for running polymorph
58
+ - name : Setup Java 17
59
+ if : matrix.language == 'java' || matrix.language == 'rust'
60
+ uses : actions/setup-java@v3
61
+ with :
62
+ distribution : " corretto"
63
+ java-version : 17
64
+
65
+ - name : Setup Python for running tests
66
+ if : matrix.language == 'python'
67
+ uses : actions/setup-python@v4
68
+ with :
69
+ python-version : 3.11
70
+ architecture : x64
71
+ - run : |
72
+ python -m pip install --upgrade pip
73
+ pip install --upgrade tox
74
+ pip install poetry
75
+
76
+ - name : Setup Rust Toolchain for GitHub CI
77
+ if : matrix.language == 'rust'
78
+ uses :
actions-rust-lang/[email protected]
79
+ with :
80
+ components : rustfmt
81
+ # TODO - uncomment this after Rust formatter works
82
+ # - name: Rustfmt Check
83
+ # uses: actions-rust-lang/rustfmt@v1
84
+
85
+ # TODO: Remove this after the formatting in Rust starts working
86
+ - name : smithy-dafny Rust hacks
87
+ if : matrix.language == 'rust'
88
+ shell : bash
89
+ run : |
90
+ if [ "$RUNNER_OS" == "macOS" ]; then
91
+ sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
92
+ else
93
+ sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
94
+ fi
95
+
96
+ - name : Setup NASM for Windows in Rust (aws-lc-sys)
97
+ if : matrix.language == 'rust' && matrix.os == 'windows-latest'
98
+ uses : ilammy/setup-nasm@v1
99
+
100
+ - name : Setup Dafny
101
+ uses :
dafny-lang/[email protected]
102
+ with :
103
+ dafny-version : ${{ inputs.dafny }}
104
+
105
+ - name : Regenerate code using smithy-dafny if necessary
106
+ if : ${{ inputs.regenerate-code }}
107
+ uses : ./.github/actions/polymorph_codegen
108
+ with :
109
+ dafny : ${{ inputs.dafny }}
110
+ library : ${{ matrix.library }}
111
+ diff-generated-code : false
112
+
113
+ # Build implementation for each runtime
114
+ - name : Build ${{ matrix.library }} implementation in Java
115
+ if : matrix.language == 'java'
116
+ shell : bash
117
+ working-directory : ./${{ matrix.library }}
118
+ run : |
119
+ # This works because `node` is installed by default on GHA runners
120
+ CORES=$(node -e 'console.log(os.cpus().length)')
121
+ make build_java CORES=$CORES
122
+
123
+ - name : Build ${{ matrix.library }} implementation in .NET
124
+ if : matrix.language == 'net'
125
+ shell : bash
126
+ working-directory : ./${{ matrix.library }}
127
+ run : |
128
+ # This works because `node` is installed by default on GHA runners
129
+ CORES=$(node -e 'console.log(os.cpus().length)')
130
+ make transpile_net
131
+
132
+ - name : Install Smithy-Dafny codegen dependencies
133
+ if : matrix.language == 'rust'
134
+ uses : ./.github/actions/install_smithy_dafny_codegen_dependencies
135
+
136
+ # TODO: Remove this after checking in Rust polymorph code
137
+ - name : Run make polymorph_rust
138
+ if : matrix.language == 'rust'
139
+ shell : bash
140
+ working-directory : ./${{ matrix.library }}
141
+ run : |
142
+ make polymorph_rust
143
+
144
+ - name : Build ${{ matrix.library }} implementation in Rust
145
+ if : matrix.language == 'rust'
146
+ shell : bash
147
+ working-directory : ./${{ matrix.library }}
148
+ run : |
149
+ CORES=$(node -e 'console.log(os.cpus().length)')
150
+ make transpile_rust CORES=$CORES
151
+
152
+ - name : Build ${{ matrix.library }} implementation in Python
153
+ if : matrix.language == 'python'
154
+ shell : bash
155
+ working-directory : ./${{ matrix.library }}
156
+ run : |
157
+ # This works because `node` is installed by default on GHA runners
158
+ CORES=$(node -e 'console.log(os.cpus().length)')
159
+ make transpile_python CORES=$CORES
160
+
161
+ - name : Setup gradle
162
+ if : matrix.language == 'java'
163
+ uses : gradle/gradle-build-action@v2
164
+ with :
165
+ gradle-version : 7.2
166
+
167
+ - name : Create Manifests
168
+ working-directory : ./${{ matrix.library }}
169
+ run : make test_generate_vectors_${{ matrix.language }}
170
+
171
+ - name : Create Encrypt Manifests
172
+ working-directory : ./${{ matrix.library }}
173
+ run : make test_encrypt_vectors_${{ matrix.language }}
174
+
175
+ - name : Upload Encrypt Manifest and keys.json files
176
+ uses : actions/upload-artifact@v4
177
+ with :
178
+ name : ${{matrix.os}}_vector_artifact_${{matrix.language}}_${{github.sha}}
179
+ path : |
180
+ ./${{matrix.library}}/runtimes/${{matrix.language}}/*.json
181
+ ./${{matrix.library}}/runtimes/${{matrix.language}}/plaintexts
182
+ ./${{matrix.library}}/runtimes/${{matrix.language}}/ciphertexts
183
+
184
+ testInteroperablity :
185
+ needs : generateEncryptVectors
186
+ strategy :
187
+ matrix :
188
+ library : [TestVectors]
189
+ os : [
190
+ # https://taskei.amazon.dev/tasks/CrypTool-5283
191
+ # windows-latest,
192
+ ubuntu-latest,
193
+ macos-13,
194
+ ]
195
+ encrypting_language : [java, net, rust, python]
196
+ decrypting_language : [java, net, rust, python]
197
+ # https://taskei.amazon.dev/tasks/CrypTool-5284
198
+ dotnet-version : ["6.0.x"]
199
+ runs-on : ${{ matrix.os }}
200
+ permissions :
201
+ id-token : write
202
+ contents : read
203
+
36
204
steps :
37
205
- name : Support longpaths on Git checkout
38
206
run : |
@@ -238,6 +406,17 @@ jobs:
238
406
distribution : " corretto"
239
407
java-version : 17
240
408
409
+ - name : Setup Python for running tests
410
+ if : matrix.decrypting_language == == 'python'
411
+ uses : actions/setup-python@v4
412
+ with :
413
+ python-version : 3.11
414
+ architecture : x64
415
+ - run : |
416
+ python -m pip install --upgrade pip
417
+ pip install --upgrade tox
418
+ pip install poetry
419
+
241
420
- name : Setup Rust Toolchain for GitHub CI
242
421
if : matrix.decrypting_language == 'rust'
243
422
uses :
actions-rust-lang/[email protected]
@@ -315,6 +494,7 @@ jobs:
315
494
CORES=$(node -e 'console.log(os.cpus().length)')
316
495
make transpile_rust CORES=$CORES
317
496
497
+ <<<<<<< HEAD
318
498
- name : Build ${{ matrix.library }} implementation in Go
319
499
if : matrix.decrypting_language == 'go'
320
500
shell : bash
@@ -331,6 +511,15 @@ jobs:
331
511
working-directory : ./${{ matrix.library }}
332
512
run : |
333
513
make purge_polymorph_code
514
+ =======
515
+ - name : Build ${{ matrix.library }} implementation in Python
516
+ if : matrix.decrypting_language == 'python'
517
+ shell : bash
518
+ working-directory : ./${{ matrix.library }}
519
+ run : |
520
+ CORES=$(node -e 'console.log(os.cpus().length)')
521
+ make transpile_python CORES=$CORES
522
+ >>>>>>> a812a13f (m)
334
523
335
524
- name : Download Encrypt Manifest Artifact
336
525
uses : actions/download-artifact@v4
0 commit comments