Skip to content

Commit 9f2ea5e

Browse files
authored
Merge branch 'main' into rkapila/shared-cache-examples
2 parents 797501f + 7b45929 commit 9f2ea5e

File tree

2,231 files changed

+285441
-199
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,231 files changed

+285441
-199
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ updates:
2020
directory: ".github/workflows"
2121
schedule:
2222
interval: "daily"
23+
- package-ecosystem: "cargo"
24+
directory: "DynamoDbEncryption/runtimes/rust"
25+
schedule:
26+
interval: "daily"

.github/workflows/daily_ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ jobs:
5656
uses: ./.github/workflows/ci_test_net.yml
5757
with:
5858
dafny: ${{needs.getVersion.outputs.version}}
59+
daily-ci-rust:
60+
needs: getVersion
61+
uses: ./.github/workflows/library_rust_tests.yml
62+
with:
63+
dafny: ${{needs.getVersion.outputs.version}}
5964
daily-ci-net-test-vectors:
6065
needs: getVersion
6166
uses: ./.github/workflows/ci_test_vector_net.yml
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# This workflow performs tests in Rust.
2+
name: Library Rust tests
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
dafny:
8+
description: "The Dafny version to run"
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+
testRust:
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
library: [DynamoDbEncryption, TestVectors]
23+
# removed windows-latest because somehow it can't build aws-lc in CI
24+
os: [ubuntu-latest, macos-13]
25+
runs-on: ${{ matrix.os }}
26+
permissions:
27+
id-token: write
28+
contents: read
29+
env:
30+
RUST_MIN_STACK: 104857600
31+
steps:
32+
- name: Support longpaths on Git checkout
33+
run: |
34+
git config --global core.longpaths true
35+
- uses: actions/checkout@v3
36+
- name: Init Submodules
37+
shell: bash
38+
run: |
39+
git submodule update --init --recursive submodules/smithy-dafny
40+
git submodule update --init --recursive submodules/MaterialProviders
41+
42+
- name: Configure AWS Credentials
43+
uses: aws-actions/configure-aws-credentials@v4
44+
with:
45+
aws-region: us-west-2
46+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
47+
role-session-name: DDBEC-Dafny-Rust-Tests
48+
49+
- name: Setup Rust Toolchain for GitHub CI
50+
uses: actions-rust-lang/[email protected]
51+
with:
52+
components: rustfmt
53+
# uncomment this after Rust formatter works
54+
# - name: Rustfmt Check
55+
# uses: actions-rust-lang/rustfmt@v1
56+
57+
- name: Setup Dafny
58+
uses: dafny-lang/[email protected]
59+
with:
60+
dafny-version: nightly-2024-12-03-4954170
61+
62+
# Remove this after the formatting in Rust starts working
63+
- name: smithy-dafny Rust hacks
64+
shell: bash
65+
run: |
66+
if [ "$RUNNER_OS" == "macOS" ]; then
67+
sed -i '' 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' submodules/smithy-dafny/SmithyDafnyMakefile.mk
68+
else
69+
sed -i 's|rustfmt --edition 2021 runtimes/rust/src/implementation_from_dafny.rs|#&|' submodules/smithy-dafny/SmithyDafnyMakefile.mk
70+
fi
71+
72+
- name: Setup Java 17 for codegen
73+
uses: actions/setup-java@v3
74+
with:
75+
distribution: "corretto"
76+
java-version: "17"
77+
78+
- name: Setup NASM for Windows (aws-lc-sys)
79+
if: matrix.os == 'windows-latest'
80+
uses: ilammy/setup-nasm@v1
81+
82+
- name: Install Smithy-Dafny codegen dependencies
83+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
84+
85+
- name: Run make polymorph_rust
86+
shell: bash
87+
working-directory: ./${{ matrix.library }}
88+
run: |
89+
make polymorph_rust
90+
91+
- name: Compile ${{ matrix.library }} implementation
92+
shell: bash
93+
working-directory: ./${{ matrix.library }}
94+
run: |
95+
# This works because `node` is installed by default on GHA runners
96+
CORES=$(node -e 'console.log(os.cpus().length)')
97+
make transpile_rust TRANSPILE_TESTS_IN_RUST=1 CORES=$CORES
98+
99+
- name: Copy ${{ matrix.library }} Vector Files
100+
if: ${{ matrix.library == 'TestVectors' }}
101+
shell: bash
102+
working-directory: ./${{ matrix.library }}
103+
run: |
104+
cp runtimes/java/*.json runtimes/rust/
105+
106+
- name: Test ${{ matrix.library }} Rust
107+
shell: bash
108+
working-directory: ./${{ matrix.library }}
109+
run: |
110+
make test_rust
111+
112+
- name: Test Examples for Rust in ${{ matrix.library }}
113+
if: ${{ matrix.library == 'DynamoDbEncryption' }}
114+
working-directory: ./${{ matrix.library }}/runtimes/rust/
115+
shell: bash
116+
run: |
117+
cargo run --release --example main

.github/workflows/manual.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ jobs:
5252
with:
5353
dafny: ${{ inputs.dafny }}
5454
regenerate-code: ${{ inputs.regenerate-code }}
55+
manual-ci-rust:
56+
uses: ./.github/workflows/library_rust_tests.yml
57+
with:
58+
dafny: ${{ inputs.dafny }}
59+
regenerate-code: ${{ inputs.regenerate-code }}
5560
manual-ci-net-test-vectors:
5661
uses: ./.github/workflows/ci_test_vector_net.yml
5762
with:

.github/workflows/mpl-head.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ jobs:
6767
with:
6868
dafny: ${{needs.getVersion.outputs.version}}
6969
mpl-head: true
70+
mpl-head-ci-rust:
71+
needs: getVersion
72+
uses: ./.github/workflows/library_rust_tests.yml
73+
with:
74+
dafny: ${{needs.getVersion.outputs.version}}
75+
mpl-head: true
7076
mpl-head-ci-net-test-vectors:
7177
needs: getVersion
7278
uses: ./.github/workflows/ci_test_vector_net.yml

.github/workflows/nightly.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ jobs:
5252
with:
5353
dafny: "nightly-latest"
5454
regenerate-code: true
55+
dafny-nightly-rust:
56+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
57+
uses: ./.github/workflows/library_rust_tests.yml
58+
with:
59+
dafny: "nightly-latest"
60+
regenerate-code: true
5561
dafny-nightly-test-vectors-net:
5662
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
5763
uses: ./.github/workflows/ci_test_vector_net.yml

.github/workflows/pull.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ jobs:
4949
uses: ./.github/workflows/ci_test_net.yml
5050
with:
5151
dafny: ${{needs.getVersion.outputs.version}}
52+
pr-ci-rust:
53+
needs: getVersion
54+
uses: ./.github/workflows/library_rust_tests.yml
55+
with:
56+
dafny: ${{needs.getVersion.outputs.version}}
5257
pr-ci-net-test-vectors:
5358
needs: getVersion
5459
uses: ./.github/workflows/ci_test_vector_net.yml

.github/workflows/push.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ jobs:
5151
uses: ./.github/workflows/ci_test_net.yml
5252
with:
5353
dafny: ${{needs.getVersion.outputs.version}}
54+
pr-ci-rust:
55+
needs: getVersion
56+
uses: ./.github/workflows/library_rust_tests.yml
57+
with:
58+
dafny: ${{needs.getVersion.outputs.version}}
5459
pr-ci-net-test-vectors:
5560
needs: getVersion
5661
uses: ./.github/workflows/ci_test_vector_net.yml

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ test/**/Output/*
1616
specification_compliance_report.html
1717
/compliance
1818
/.smithy.lsp.log
19+
20+
# logs
21+
*.log

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
submodules
2+
target

0 commit comments

Comments
 (0)