Skip to content

Commit 9e44e54

Browse files
authored
Merge branch 'main' into robin-aws/fix-nightly-build-2024-10-28
2 parents e48dfc4 + 6173888 commit 9e44e54

File tree

51 files changed

+146695
-1380
lines changed

Some content is hidden

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

51 files changed

+146695
-1380
lines changed

.github/actions/install_smithy_dafny_codegen_dependencies/action.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,40 @@ description: "Install Java package dependencies required to run Smithy-Dafny cod
88
runs:
99
using: "composite"
1010
steps:
11-
- name: Setup Java 17 for smithy-dafny
11+
- name: Setup Java 17 for codegen
1212
uses: actions/setup-java@v3
1313
with:
1414
distribution: "corretto"
15-
java-version: 17
15+
java-version: "17"
1616

17-
- name: Install smithy-dafny-codegen Rust dependencies locally
18-
uses: gradle/gradle-build-action@v2
17+
- name: Install smithy-dafny-codegen dependencies locally
18+
shell: bash
19+
run: |
20+
make -C submodules/smithy-dafny mvn_local_deploy_polymorph_dependencies
21+
22+
- name: Setup Python, black, and docformatter for code formatting
23+
uses: actions/setup-python@v4
1924
with:
20-
arguments: :codegen-client:pTML :codegen-core:pTML :rust-runtime:pTML
21-
build-root-directory: submodules/smithy-dafny/smithy-dafny-codegen-modules/smithy-rs
25+
python-version: ${{ matrix.python-version }}
26+
architecture: x64
27+
- shell: bash
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install --upgrade black
31+
python -m pip install --upgrade docformatter
2232
23-
- name: Install smithy-dafny-codegen Python dependencies locally
24-
uses: gradle/gradle-build-action@v2
33+
- name: Install Go
34+
uses: actions/setup-go@v5
2535
with:
26-
arguments: :smithy-python-codegen:pTML
27-
build-root-directory: submodules/smithy-dafny/codegen/smithy-dafny-codegen-modules/smithy-python/codegen
36+
go-version: "1.23"
37+
38+
- name: Install Go imports
39+
shell: bash
40+
run: |
41+
go install golang.org/x/tools/cmd/goimports@latest
2842
2943
# Without this the if-dafny-at-least command includes "Downloading ..." output
3044
- name: Arbitrary makefile target to force downloading Gradle
3145
shell: bash
3246
run: |
33-
make -C DynamoDbEncryption setup_net
47+
make -C submodules/MaterialProviders/StandardLibrary setup_net

.github/workflows/ci_examples_net.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ jobs:
6060
git rev-parse HEAD
6161
6262
- name: Install Smithy-Dafny codegen dependencies
63-
if: ${{ inputs.regenerate-code }}
6463
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
6564

6665
- name: Regenerate code using smithy-dafny if necessary

.github/workflows/ci_test_go.yml

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

.github/workflows/ci_test_latest_released_mpl_java.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
dafny-version: ${{ needs.getVersion.outputs.version }}
6060

6161
- name: Install Smithy-Dafny codegen dependencies
62-
if: ${{ inputs.regenerate-code }}
6362
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
6463

6564
- name: Regenerate code using smithy-dafny if necessary

.github/workflows/ci_test_net.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ jobs:
6161
git rev-parse HEAD
6262
6363
- name: Install Smithy-Dafny codegen dependencies
64-
if: ${{ inputs.regenerate-code }}
6564
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
6665

6766
- name: Regenerate code using smithy-dafny if necessary

.github/workflows/ci_test_vector_net.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ jobs:
9696
- name: Test TestVectors on .NET 6.0
9797
working-directory: ./${{matrix.library}}/runtimes/net
9898
run: |
99-
cp ../java/decrypt_java_*.json ../java/decrypt_dotnet_*.json ../java/decrypt_rust_*.json ../java/large_records.json .
100-
dotnet run
10199
cp ../java/*.json .
100+
dotnet run
102101
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

.github/workflows/daily_ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ jobs:
6161
uses: ./.github/workflows/library_rust_tests.yml
6262
with:
6363
dafny: ${{needs.getVersion.outputs.version}}
64+
daily-ci-go:
65+
needs: getVersion
66+
uses: ./.github/workflows/ci_test_go.yml
67+
with:
68+
dafny: ${{needs.getVersion.outputs.version}}
6469
daily-ci-net-test-vectors:
6570
needs: getVersion
6671
uses: ./.github/workflows/ci_test_vector_net.yml

.github/workflows/pull.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ jobs:
5454
uses: ./.github/workflows/library_rust_tests.yml
5555
with:
5656
dafny: ${{needs.getVersion.outputs.version}}
57+
pr-ci-go:
58+
needs: getVersion
59+
uses: ./.github/workflows/ci_test_go.yml
60+
with:
61+
dafny: ${{needs.getVersion.outputs.version}}
5762
pr-ci-net-test-vectors:
5863
needs: getVersion
5964
uses: ./.github/workflows/ci_test_vector_net.yml
@@ -78,6 +83,7 @@ jobs:
7883
- pr-ci-java-examples
7984
- pr-ci-net
8085
- pr-ci-rust
86+
- pr-ci-go
8187
- pr-ci-net-test-vectors
8288
- pr-ci-net-examples
8389
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)