Skip to content

Commit 7092015

Browse files
committed
Merge branch 'main' into python-reviewed
2 parents de4588f + fed53bf commit 7092015

File tree

239 files changed

+448954
-8799
lines changed

Some content is hidden

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

239 files changed

+448954
-8799
lines changed

.github/actions/install_smithy_dafny_codegen_dependencies/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ runs:
3131
python -m pip install --upgrade docformatter
3232
3333
- name: Install Go
34-
uses: actions/setup-go@v5
34+
uses: actions/setup-go@v2
3535
with:
3636
go-version: "1.23"
3737

.github/actions/polymorph_codegen/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ runs:
141141
run: |
142142
make polymorph_dotnet ${{ steps.dependencies.outputs.PROJECT_DEPENDENCIES }}
143143
144+
- name: Regenerate Go code using smithy-dafny
145+
working-directory: ./${{ inputs.library }}
146+
shell: bash
147+
run: |
148+
make polymorph_go
149+
144150
- name: Check regenerated code against commited code
145151
# Composite action inputs seem to not actually support booleans properly for some reason
146152
if: inputs.diff-generated-code == 'true'

.github/workflows/ci_codegen.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
# in this workflow
1919
dotnet-version: ["6.0.x"]
2020
os: [ubuntu-22.04]
21+
go-version: [1.23]
2122
runs-on: ${{ matrix.os }}
2223
defaults:
2324
run:
@@ -48,6 +49,11 @@ jobs:
4849
with:
4950
dotnet-version: ${{ matrix.dotnet-version }}
5051

52+
- name: Install Go
53+
uses: actions/setup-go@v5
54+
with:
55+
go-version: ${{ matrix.go-version }}
56+
5157
- name: Create temporary global.json
5258
run: echo '{"sdk":{"rollForward":"latestFeature","version":"6.0.0"}}' > ./global.json
5359

.github/workflows/ci_examples_java.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ on:
2626
jobs:
2727
testJava:
2828
strategy:
29-
max-parallel: 1
3029
matrix:
3130
java-version: [8, 11, 16, 17]
3231
os: [macos-13]

.github/workflows/ci_examples_net.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,4 @@ jobs:
9494
shell: bash
9595
run: |
9696
dotnet run
97+
dotnet test

.github/workflows/ci_test_go.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# This workflow performs tests in Go.
2+
name: Library Go 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+
mpl-version:
17+
description: "MPL version to use"
18+
required: false
19+
type: string
20+
mpl-head:
21+
description: "Running on MPL HEAD"
22+
required: false
23+
default: false
24+
type: boolean
25+
26+
jobs:
27+
testGo:
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
library: [DynamoDbEncryption, TestVectors]
32+
os: [ubuntu-22.04, macos-13]
33+
go-version: ["1.23", "1.24", "1.25"]
34+
runs-on: ${{ matrix.os }}
35+
permissions:
36+
id-token: write
37+
contents: read
38+
steps:
39+
- name: Setup Docker
40+
if: matrix.os == 'macos-13' && matrix.library == 'TestVectors'
41+
uses: douglascamata/setup-docker-macos-action@v1-alpha
42+
43+
- name: Setup DynamoDB Local
44+
if: matrix.library == 'TestVectors'
45+
uses: rrainn/[email protected]
46+
with:
47+
port: 8000
48+
cors: "*"
49+
50+
- name: Support longpaths
51+
run: |
52+
git config --global core.longpaths true
53+
54+
- name: Configure AWS Credentials
55+
uses: aws-actions/configure-aws-credentials@v4
56+
with:
57+
aws-region: us-west-2
58+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
59+
role-session-name: DDBEC-Dafny-Java-Tests
60+
61+
- uses: actions/checkout@v3
62+
with:
63+
submodules: recursive
64+
65+
- name: Setup Dafny
66+
uses: dafny-lang/[email protected]
67+
with:
68+
dafny-version: ${{ inputs.dafny }}
69+
70+
- name: Create temporary global.json
71+
run: echo '{"sdk":{"rollForward":"latestFeature","version":"6.0.0"}}' > ./global.json
72+
73+
- name: Setup Java 17 for codegen
74+
uses: actions/setup-java@v3
75+
with:
76+
distribution: "corretto"
77+
java-version: "17"
78+
79+
- name: Update MPL submodule if using MPL HEAD
80+
if: ${{ inputs.mpl-head == true }}
81+
working-directory: submodules/MaterialProviders
82+
run: |
83+
git checkout main
84+
git pull
85+
git submodule update --init --recursive
86+
git rev-parse HEAD
87+
88+
- name: Update project.properties if using MPL HEAD
89+
if: ${{ inputs.mpl-head == true }}
90+
run: |
91+
sed "s/mplDependencyJavaVersion=.*/mplDependencyJavaVersion=${{inputs.mpl-version}}/g" project.properties > project.properties2; mv project.properties2 project.properties
92+
93+
- name: Install Go
94+
uses: actions/setup-go@v5
95+
with:
96+
go-version: ${{ matrix.go-version }}
97+
98+
- uses: actions/checkout@v3
99+
- name: Init Submodules
100+
shell: bash
101+
run: |
102+
git submodule update --init --recursive submodules/smithy-dafny
103+
git submodule update --init --recursive submodules/MaterialProviders
104+
105+
- name: Install Smithy-Dafny codegen dependencies
106+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
107+
108+
- name: Build ${{ matrix.library }} implementation
109+
shell: bash
110+
working-directory: ./${{ matrix.library }}
111+
run: |
112+
# This works because `node` is installed by default on GHA runners
113+
CORES=$(node -e 'console.log(os.cpus().length)')
114+
make transpile_go CORES=$CORES
115+
116+
- name: Regenerate code using smithy-dafny
117+
shell: bash
118+
working-directory: ./${{ matrix.library }}
119+
run: |
120+
make polymorph_go
121+
122+
- name: Copy ${{ matrix.library }} Vector Files
123+
if: ${{ matrix.library == 'TestVectors' }}
124+
shell: bash
125+
working-directory: ./${{ matrix.library }}
126+
run: |
127+
cp runtimes/java/*.json runtimes/go/TestsFromDafny-go/
128+
129+
- name: Test ${{ matrix.library }}
130+
working-directory: ./${{ matrix.library }}
131+
run: |
132+
make test_go
133+
134+
- name: Run and Test Examples
135+
if: matrix.library == 'DynamoDbEncryption'
136+
working-directory: ./Examples/runtimes/go
137+
run: |
138+
go run main.go
139+
go test ./...

.github/workflows/ci_test_java.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ on:
2626
jobs:
2727
testJava:
2828
strategy:
29+
fail-fast: false
2930
matrix:
3031
library: [DynamoDbEncryption]
3132
java-version: [8, 11, 16, 17]

.github/workflows/ci_test_vector_net.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ jobs:
9797
- name: Test TestVectors on .NET 6.0
9898
working-directory: ./${{matrix.library}}/runtimes/net
9999
run: |
100-
cp ../java/decrypt_java_*.json ../java/decrypt_dotnet_*.json ../java/decrypt_rust_*.json ../java/large_records.json .
101-
dotnet run
102100
cp ../java/*.json .
101+
dotnet run
103102
dotnet run --framework net6.0

.github/workflows/ci_todos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
shell: bash
1818
# TODOs may be committed as long as the same line contains a link to a Github Issue or refers to a CrypTool SIM.
1919
run: |
20-
ALL_TODO_COUNT=$( { grep -r "TODO" . --exclude-dir=./releases --exclude-dir=./TestVectors/runtimes --exclude-dir=./submodules --exclude-dir=./.git --exclude=./.github/workflows/ci_todos.yml || true; } | wc -l)
21-
GOOD_TODO_COUNT=$( { grep -r "TODO.*\(github.com\/.*issues.*\/[1-9][0-9]*\|CrypTool-[1-9][0-9]*\)" . --exclude-dir=./releases --exclude-dir=./submodules --exclude-dir=./.git --exclude-dir=./TestVectors/runtimes --exclude=./.github/workflows/ci_todos.yml || true; } | wc -l)
20+
ALL_TODO_COUNT=$( { grep -r "TODO" . --exclude-dir=./releases --exclude-dir=./TestVectors/runtimes --exclude-dir=./submodules --exclude-dir=./.git --exclude=./.github/workflows/ci_todos.yml | grep -v "context\.TODO()" || true; } | wc -l)
21+
GOOD_TODO_COUNT=$( { grep -r "TODO.*\(github.com\/.*issues.*\/[1-9][0-9]*\|CrypTool-[1-9][0-9]*\)" . --exclude-dir=./releases --exclude-dir=./submodules --exclude-dir=./.git --exclude-dir=./TestVectors/runtimes --exclude=./.github/workflows/ci_todos.yml | grep -v "context\.TODO()" || true; } | wc -l)
2222
if [ "$ALL_TODO_COUNT" != "$GOOD_TODO_COUNT" ]; then
2323
exit 1;
2424
fi

.github/workflows/dafny_interop_test_vector_net.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ jobs:
108108
- name: Test TestVectors on .NET 6.0
109109
working-directory: ./${{matrix.library}}/runtimes/net
110110
run: |
111-
cp ../java/decrypt_java_*.json ../java/decrypt_dotnet_*.json ../java/decrypt_rust_*.json .
112-
dotnet run
113111
cp ../java/*.json .
112+
dotnet run
114113
dotnet run --framework net6.0

0 commit comments

Comments
 (0)