Skip to content

Commit d69f253

Browse files
chore(dafny): make CI to work for all runtimes (#1871)
1 parent f709b9d commit d69f253

File tree

9 files changed

+103
-98
lines changed

9 files changed

+103
-98
lines changed

.github/workflows/ci_test_go.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
strategy:
2929
matrix:
3030
library: [DynamoDbEncryption, TestVectors]
31-
os: [ubuntu-22.04]
31+
os: [ubuntu-22.04, macos-13]
3232
go-version: ["1.23"]
3333
runs-on: ${{ matrix.os }}
3434
permissions:
@@ -45,7 +45,7 @@ jobs:
4545
with:
4646
port: 8000
4747
cors: "*"
48-
48+
4949
- name: Support longpaths
5050
run: |
5151
git config --global core.longpaths true
@@ -68,7 +68,7 @@ jobs:
6868

6969
- name: Create temporary global.json
7070
run: echo '{"sdk":{"rollForward":"latestFeature","version":"6.0.0"}}' > ./global.json
71-
71+
7272
- name: Setup Java 17 for codegen
7373
uses: actions/setup-java@v3
7474
with:
@@ -104,7 +104,7 @@ jobs:
104104
run: |
105105
git submodule update --init --recursive submodules/smithy-dafny
106106
git submodule update --init --recursive submodules/MaterialProviders
107-
107+
108108
- name: Install Smithy-Dafny codegen dependencies
109109
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
110110

@@ -121,14 +121,14 @@ jobs:
121121
working-directory: ./${{ matrix.library }}
122122
run: |
123123
make polymorph_go
124-
124+
125125
- name: Copy ${{ matrix.library }} Vector Files
126126
if: ${{ matrix.library == 'TestVectors' }}
127127
shell: bash
128128
working-directory: ./${{ matrix.library }}
129129
run: |
130130
cp runtimes/java/*.json runtimes/go/TestsFromDafny-go/
131-
131+
132132
- name: Test ${{ matrix.library }}
133133
working-directory: ./${{ matrix.library }}
134134
run: |

.github/workflows/ci_todos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
# 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)
2323
# if [ "$ALL_TODO_COUNT" != "$GOOD_TODO_COUNT" ]; then
2424
# exit 1;
25-
# fi
25+
# fi

.github/workflows/pull.yml

Lines changed: 78 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,94 @@
11
# This workflow runs for every pull request
2-
# TODO: CI for Go
32
name: PR CI
43

54
on:
65
pull_request:
7-
push:
8-
branches:
9-
- Golang/reviewed
10-
schedule:
11-
- cron: "00 16 * * 1-5"
126

137
jobs:
148
getVersion:
159
uses: ./.github/workflows/dafny_version.yml
1610
getVerifyVersion:
1711
uses: ./.github/workflows/dafny_verify_version.yml
18-
# pr-ci-format:
19-
# needs: getVersion
20-
# uses: ./.github/workflows/library_format.yml
21-
# with:
22-
# dafny: ${{needs.getVersion.outputs.version}}
23-
# pr-ci-codegen:
24-
# needs: getVersion
25-
# uses: ./.github/workflows/ci_codegen.yml
26-
# with:
27-
# dafny: ${{needs.getVersion.outputs.version}}
28-
# pr-ci-verification:
29-
# needs: getVerifyVersion
30-
# uses: ./.github/workflows/library_dafny_verification.yml
31-
# with:
32-
# dafny: ${{needs.getVerifyVersion.outputs.version}}
33-
# pr-ci-test-vector-verification:
34-
# needs: getVerifyVersion
35-
# uses: ./.github/workflows/test_vector_verification.yml
36-
# with:
37-
# dafny: ${{needs.getVerifyVersion.outputs.version}}
38-
# pr-ci-java:
39-
# needs: getVersion
40-
# uses: ./.github/workflows/ci_test_java.yml
41-
# with:
42-
# dafny: ${{needs.getVersion.outputs.version}}
43-
# pr-ci-java-test-vectors:
44-
# needs: getVersion
45-
# uses: ./.github/workflows/ci_test_vector_java.yml
46-
# with:
47-
# dafny: ${{needs.getVersion.outputs.version}}
48-
# pr-ci-java-examples:
49-
# needs: getVersion
50-
# uses: ./.github/workflows/ci_examples_java.yml
51-
# with:
52-
# dafny: ${{needs.getVersion.outputs.version}}
53-
# pr-ci-net:
54-
# needs: getVersion
55-
# uses: ./.github/workflows/ci_test_net.yml
56-
# with:
57-
# dafny: ${{needs.getVersion.outputs.version}}
58-
# pr-ci-rust:
59-
# needs: getVersion
60-
# uses: ./.github/workflows/library_rust_tests.yml
61-
# with:
62-
# dafny: ${{needs.getVersion.outputs.version}}
12+
pr-ci-format:
13+
needs: getVersion
14+
uses: ./.github/workflows/library_format.yml
15+
with:
16+
dafny: ${{needs.getVersion.outputs.version}}
17+
pr-ci-codegen:
18+
needs: getVersion
19+
uses: ./.github/workflows/ci_codegen.yml
20+
with:
21+
dafny: ${{needs.getVersion.outputs.version}}
22+
pr-ci-verification:
23+
needs: getVerifyVersion
24+
uses: ./.github/workflows/library_dafny_verification.yml
25+
with:
26+
dafny: ${{needs.getVerifyVersion.outputs.version}}
27+
pr-ci-test-vector-verification:
28+
needs: getVerifyVersion
29+
uses: ./.github/workflows/test_vector_verification.yml
30+
with:
31+
dafny: ${{needs.getVerifyVersion.outputs.version}}
32+
pr-ci-java:
33+
needs: getVersion
34+
uses: ./.github/workflows/ci_test_java.yml
35+
with:
36+
dafny: ${{needs.getVersion.outputs.version}}
37+
pr-ci-java-test-vectors:
38+
needs: getVersion
39+
uses: ./.github/workflows/ci_test_vector_java.yml
40+
with:
41+
dafny: ${{needs.getVersion.outputs.version}}
42+
pr-ci-java-examples:
43+
needs: getVersion
44+
uses: ./.github/workflows/ci_examples_java.yml
45+
with:
46+
dafny: ${{needs.getVersion.outputs.version}}
47+
pr-ci-net:
48+
needs: getVersion
49+
uses: ./.github/workflows/ci_test_net.yml
50+
with:
51+
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}}
6357
pr-ci-go:
6458
needs: getVersion
6559
uses: ./.github/workflows/ci_test_go.yml
6660
with:
6761
dafny: ${{needs.getVersion.outputs.version}}
68-
# pr-ci-net-test-vectors:
69-
# needs: getVersion
70-
# uses: ./.github/workflows/ci_test_vector_net.yml
71-
# with:
72-
# dafny: ${{needs.getVersion.outputs.version}}
73-
# pr-ci-net-examples:
74-
# needs: getVersion
75-
# uses: ./.github/workflows/ci_examples_net.yml
76-
# with:
77-
# dafny: ${{needs.getVersion.outputs.version}}
78-
# pr-ci-all-required:
79-
# if: always()
80-
# needs:
81-
# - getVersion
82-
# - getVerifyVersion
83-
# - pr-ci-format
84-
# - pr-ci-codegen
85-
# - pr-ci-verification
86-
# - pr-ci-test-vector-verification
87-
# - pr-ci-java
88-
# - pr-ci-java-test-vectors
89-
# - pr-ci-java-examples
90-
# - pr-ci-net
91-
# - pr-ci-rust
92-
# - pr-ci-net-test-vectors
93-
# - pr-ci-net-examples
94-
# runs-on: ubuntu-22.04
95-
# steps:
96-
# - name: Verify all required jobs passed
97-
# uses: re-actors/alls-green@release/v1
98-
# with:
99-
# jobs: ${{ toJSON(needs) }}
62+
pr-ci-net-test-vectors:
63+
needs: getVersion
64+
uses: ./.github/workflows/ci_test_vector_net.yml
65+
with:
66+
dafny: ${{needs.getVersion.outputs.version}}
67+
pr-ci-net-examples:
68+
needs: getVersion
69+
uses: ./.github/workflows/ci_examples_net.yml
70+
with:
71+
dafny: ${{needs.getVersion.outputs.version}}
72+
pr-ci-all-required:
73+
if: always()
74+
needs:
75+
- getVersion
76+
- getVerifyVersion
77+
- pr-ci-format
78+
- pr-ci-codegen
79+
- pr-ci-verification
80+
- pr-ci-test-vector-verification
81+
- pr-ci-java
82+
- pr-ci-java-test-vectors
83+
- pr-ci-java-examples
84+
- pr-ci-net
85+
- pr-ci-rust
86+
- pr-ci-go
87+
- pr-ci-net-test-vectors
88+
- pr-ci-net-examples
89+
runs-on: ubuntu-22.04
90+
steps:
91+
- name: Verify all required jobs passed
92+
uses: re-actors/alls-green@release/v1
93+
with:
94+
jobs: ${{ toJSON(needs) }}

.github/workflows/push.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# This workflow runs for every push to main
2-
# TODO: CI for Go
32
name: Push CI
43

54
on:
@@ -57,6 +56,11 @@ jobs:
5756
uses: ./.github/workflows/library_rust_tests.yml
5857
with:
5958
dafny: ${{needs.getVersion.outputs.version}}
59+
pr-ci-go:
60+
needs: getVersion
61+
uses: ./.github/workflows/ci_test_go.yml
62+
with:
63+
dafny: ${{needs.getVersion.outputs.version}}
6064
pr-ci-net-test-vectors:
6165
needs: getVersion
6266
uses: ./.github/workflows/ci_test_vector_net.yml

DynamoDbEncryption/dafny/DynamoDbEncryption/src/Index.dfy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ include "UpdateExpr.dfy"
1616
include "Util.dfy"
1717
include "Virtual.dfy"
1818

19-
module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny" } DynamoDbEncryption
19+
module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.internaldafny" } DynamoDbEncryption
2020
refines AbstractAwsCryptographyDbEncryptionSdkDynamoDbService
2121
{
2222
import Operations = AwsCryptographyDbEncryptionSdkDynamoDbOperations

DynamoDbEncryption/dafny/DynamoDbItemEncryptor/src/Index.dfy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
include "AwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorOperations.dfy"
55
include "Util.dfy"
66

7-
module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny" } DynamoDbItemEncryptor
7+
module {:extern "software.amazon.cryptography.dbencryptionsdk.dynamodb.itemencryptor.internaldafny" } DynamoDbItemEncryptor
88
refines AbstractAwsCryptographyDbEncryptionSdkDynamoDbItemEncryptorService
99
{
1010
import opened DynamoDbItemEncryptorUtil

DynamoDbEncryption/dafny/StructuredEncryption/src/Index.dfy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
include "AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations.dfy"
55

6-
module {:extern "software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny" } StructuredEncryption
6+
module {:extern "software.amazon.cryptography.dbencryptionsdk.structuredencryption.internaldafny" } StructuredEncryption
77
refines AbstractAwsCryptographyDbEncryptionSdkStructuredEncryptionService
88
{
99

TestVectors/dafny/DDBEncryption/src/Index.dfy

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@ module WrappedDDBEncryptionMain {
1919
import KeyVectorsTypes = AwsCryptographyMaterialProvidersTestVectorKeysTypes
2020
import WrappedItemEncryptor
2121

22-
// TODO: Add extern for DEFAULT_KEYS
23-
const DEFAULT_KEYS : string := "../../../../submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/keys.json"
22+
function method GetDefaultKeysPath(): string
23+
{
24+
var mplKeysPath := "submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/test/keys.json";
25+
if OsLang.GetLanguageShort() == "Go" then
26+
"../../../../" + mplKeysPath
27+
else
28+
"../../../" + mplKeysPath
29+
}
2430

2531
method AddJson(prev : TestVectorConfig, file : string, keyVectors: KeyVectors.KeyVectorsClient)
2632
returns (output : Result<TestVectorConfig, string>)
@@ -52,7 +58,7 @@ module WrappedDDBEncryptionMain {
5258
// Parsing JSON is very slow in Python. Parse JSON as infrequently as possible.
5359
var keyVectors :- expect KeyVectors.KeyVectors(
5460
KeyVectorsTypes.KeyVectorsConfig(
55-
keyManifestPath := DEFAULT_KEYS
61+
keyManifestPath := GetDefaultKeysPath()
5662
)
5763
);
5864

submodules/smithy-dafny

0 commit comments

Comments
 (0)