25
25
ubuntu-latest,
26
26
macos-13,
27
27
]
28
- language : [java, net]
28
+ language : [java, net, rust ]
29
29
# https://taskei.amazon.dev/tasks/CrypTool-5284
30
30
dotnet-version : ["6.0.x"]
31
31
runs-on : ${{ matrix.os }}
38
38
run : |
39
39
git config --global core.longpaths true
40
40
41
+ # TestVectors will call KMS
42
+ - name : Configure AWS Credentials
43
+ uses : aws-actions/configure-aws-credentials@v2
44
+ with :
45
+ aws-region : us-west-2
46
+ role-to-assume : arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
47
+ role-session-name : InterOpTests
48
+
41
49
- uses : actions/checkout@v3
42
50
# Not all submodules are needed.
43
51
# We manually pull the submodule we DO need.
@@ -51,15 +59,40 @@ jobs:
51
59
with :
52
60
dotnet-version : ${{ matrix.dotnet-version }}
53
61
62
+ # Setup Java in Rust is needed for running polymorph
54
63
- name : Setup Java 17
55
- if : matrix.language == 'java'
64
+ if : matrix.language == 'java' || matrix.language == 'rust'
56
65
uses : actions/setup-java@v3
57
66
with :
58
67
distribution : " corretto"
59
68
java-version : 17
60
69
70
+ - name : Setup Rust Toolchain for GitHub CI
71
+ if : matrix.language == 'rust'
72
+ uses :
actions-rust-lang/[email protected]
73
+ with :
74
+ components : rustfmt
75
+ # TODO - uncomment this after Rust formatter works
76
+ # - name: Rustfmt Check
77
+ # uses: actions-rust-lang/rustfmt@v1
78
+
79
+ # TODO: Remove this after the formatting in Rust starts working
80
+ - name : smithy-dafny Rust hacks
81
+ if : matrix.language == 'rust'
82
+ shell : bash
83
+ run : |
84
+ if [ "$RUNNER_OS" == "macOS" ]; then
85
+ sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
86
+ else
87
+ sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
88
+ fi
89
+
90
+ - name : Setup NASM for Windows in Rust (aws-lc-sys)
91
+ if : matrix.language == 'rust' && matrix.os == 'windows-latest'
92
+ uses : ilammy/setup-nasm@v1
93
+
61
94
- name : Setup Dafny
62
- uses : dafny-lang/setup-dafny-action@v1.6.1
95
+ uses : dafny-lang/setup-dafny-action@v1.7.0
63
96
with :
64
97
dafny-version : ${{ inputs.dafny }}
65
98
@@ -89,21 +122,33 @@ jobs:
89
122
# This works because `node` is installed by default on GHA runners
90
123
CORES=$(node -e 'console.log(os.cpus().length)')
91
124
make transpile_net
92
-
125
+
126
+ - name : Install Smithy-Dafny codegen dependencies
127
+ if : matrix.language == 'rust'
128
+ uses : ./.github/actions/install_smithy_dafny_codegen_dependencies
129
+
130
+ # TODO: Remove this after checking in Rust polymorph code
131
+ - name : Run make polymorph_rust
132
+ if : matrix.language == 'rust'
133
+ shell : bash
134
+ working-directory : ./${{ matrix.library }}
135
+ run : |
136
+ make polymorph_rust
137
+
138
+ - name : Build ${{ matrix.library }} implementation in Rust
139
+ if : matrix.language == 'rust'
140
+ shell : bash
141
+ working-directory : ./${{ matrix.library }}
142
+ run : |
143
+ CORES=$(node -e 'console.log(os.cpus().length)')
144
+ make transpile_rust CORES=$CORES
145
+
93
146
- name : Setup gradle
94
147
if : matrix.language == 'java'
95
148
uses : gradle/gradle-build-action@v2
96
149
with :
97
150
gradle-version : 7.2
98
151
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
152
- name : Create Manifests
108
153
working-directory : ./${{ matrix.library }}
109
154
run : make test_generate_vectors_${{ matrix.language }}
@@ -132,8 +177,8 @@ jobs:
132
177
ubuntu-latest,
133
178
macos-13,
134
179
]
135
- encrypting_language : [java, net]
136
- decrypting_language : [java, net]
180
+ encrypting_language : [java, net, rust ]
181
+ decrypting_language : [java, net, rust ]
137
182
# https://taskei.amazon.dev/tasks/CrypTool-5284
138
183
dotnet-version : ["6.0.x"]
139
184
runs-on : ${{ matrix.os }}
@@ -145,6 +190,7 @@ jobs:
145
190
- name : Support longpaths on Git checkout
146
191
run : |
147
192
git config --global core.longpaths true
193
+
148
194
# TestVectors will call KMS
149
195
- name : Configure AWS Credentials
150
196
uses : aws-actions/configure-aws-credentials@v2
@@ -159,19 +205,45 @@ jobs:
159
205
- run : git submodule update --init libraries
160
206
- run : git submodule update --init --recursive mpl
161
207
208
+ # Set up runtimes
162
209
- name : Setup .NET Core SDK ${{ matrix.dotnet-version }}
163
210
if : matrix.decrypting_language == 'net'
164
211
uses : actions/setup-dotnet@v3
165
212
with :
166
213
dotnet-version : ${{ matrix.dotnet-version }}
167
214
215
+ # Setup Java in Rust is needed for running polymorph
168
216
- name : Setup Java 17
169
- if : matrix.decrypting_language == 'java'
217
+ if : matrix.decrypting_language == 'java' || matrix.decrypting_language == 'rust'
170
218
uses : actions/setup-java@v3
171
219
with :
172
220
distribution : " corretto"
173
221
java-version : 17
174
222
223
+ - name : Setup Rust Toolchain for GitHub CI
224
+ if : matrix.decrypting_language == 'rust'
225
+ uses :
actions-rust-lang/[email protected]
226
+ with :
227
+ components : rustfmt
228
+ # TODO - uncomment this after Rust formatter works
229
+ # - name: Rustfmt Check
230
+ # uses: actions-rust-lang/rustfmt@v1
231
+
232
+ # TODO: Remove this after the formatting in Rust starts working
233
+ - name : smithy-dafny Rust hacks
234
+ if : matrix.decrypting_language == 'rust'
235
+ shell : bash
236
+ run : |
237
+ if [ "$RUNNER_OS" == "macOS" ]; then
238
+ sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
239
+ else
240
+ sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' mpl/smithy-dafny/SmithyDafnyMakefile.mk
241
+ fi
242
+
243
+ - name : Setup NASM for Windows in Rust (aws-lc-sys)
244
+ if : matrix.decrypting_language == 'rust' && matrix.os == 'windows-latest'
245
+ uses : ilammy/setup-nasm@v1
246
+
175
247
- name : Setup Dafny
176
248
uses :
dafny-lang/[email protected]
177
249
with :
@@ -204,6 +276,26 @@ jobs:
204
276
CORES=$(node -e 'console.log(os.cpus().length)')
205
277
make transpile_net
206
278
279
+ - name : Install Smithy-Dafny codegen dependencies
280
+ if : matrix.decrypting_language == 'rust'
281
+ uses : ./.github/actions/install_smithy_dafny_codegen_dependencies
282
+
283
+ # TODO: Remove this after checking in Rust polymorph code
284
+ - name : Run make polymorph_rust
285
+ if : matrix.decrypting_language == 'rust'
286
+ shell : bash
287
+ working-directory : ./${{ matrix.library }}
288
+ run : |
289
+ make polymorph_rust
290
+
291
+ - name : Build ${{ matrix.library }} implementation in Rust
292
+ if : matrix.decrypting_language == 'rust'
293
+ shell : bash
294
+ working-directory : ./${{ matrix.library }}
295
+ run : |
296
+ CORES=$(node -e 'console.log(os.cpus().length)')
297
+ make transpile_rust CORES=$CORES
298
+
207
299
- name : Download Encrypt Manifest Artifact
208
300
uses : actions/download-artifact@v4
209
301
with :
0 commit comments