Skip to content

Commit 744e6ae

Browse files
Workflow
1 parent 1a23e65 commit 744e6ae

File tree

2 files changed

+175
-52
lines changed

2 files changed

+175
-52
lines changed

.github/workflows/ci_test_go.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 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]
31+
os: [ubuntu-22.04]
32+
go-version: ["1.23"]
33+
runs-on: ${{ matrix.os }}
34+
permissions:
35+
id-token: write
36+
contents: read
37+
steps:
38+
- name: Support longpaths
39+
run: |
40+
git config --global core.longpaths true
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-Java-Tests
48+
49+
- uses: actions/checkout@v3
50+
with:
51+
submodules: recursive
52+
53+
- name: Setup Dafny
54+
uses: dafny-lang/[email protected]
55+
with:
56+
dafny-version: ${{ inputs.dafny }}
57+
58+
- name: Create temporary global.json
59+
run: echo '{"sdk":{"rollForward":"latestFeature","version":"6.0.0"}}' > ./global.json
60+
61+
- name: Setup Java 17 for codegen
62+
uses: actions/setup-java@v3
63+
with:
64+
distribution: "corretto"
65+
java-version: "17"
66+
67+
- name: Update MPL submodule if using MPL HEAD
68+
if: ${{ inputs.mpl-head == true }}
69+
working-directory: submodules/MaterialProviders
70+
run: |
71+
git checkout main
72+
git pull
73+
git submodule update --init --recursive
74+
git rev-parse HEAD
75+
76+
- name: Update project.properties if using MPL HEAD
77+
if: ${{ inputs.mpl-head == true }}
78+
run: |
79+
sed "s/mplDependencyJavaVersion=.*/mplDependencyJavaVersion=${{inputs.mpl-version}}/g" project.properties > project.properties2; mv project.properties2 project.properties
80+
81+
- name: Install Go
82+
uses: actions/setup-go@v5
83+
with:
84+
go-version: ${{ matrix.go-version }}
85+
86+
- name: Install Go imports
87+
run: |
88+
go install golang.org/x/tools/cmd/goimports@latest
89+
90+
- uses: actions/checkout@v3
91+
- name: Init Submodules
92+
shell: bash
93+
run: |
94+
git submodule update --init --recursive submodules/smithy-dafny
95+
git submodule update --init --recursive submodules/MaterialProviders
96+
97+
- name: Install Smithy-Dafny codegen dependencies
98+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
99+
100+
- name: Regenerate code using smithy-dafny
101+
shell: bash
102+
working-directory: ./${{ matrix.library }}
103+
run: |
104+
make polymorph_go
105+
106+
- name: Build ${{ matrix.library }} implementation
107+
shell: bash
108+
working-directory: ./${{ matrix.library }}
109+
run: |
110+
# This works because `node` is installed by default on GHA runners
111+
CORES=$(node -e 'console.log(os.cpus().length)')
112+
make transpile_go CORES=$CORES
113+
114+
- name: Test ${{ matrix.library }}
115+
working-directory: ./${{ matrix.library }}
116+
run: |
117+
make test_go

.github/workflows/push.yml

Lines changed: 58 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,70 @@ on:
55
push:
66
branches:
77
- main
8+
- Golang/*
89

910
jobs:
1011
getVersion:
1112
uses: ./.github/workflows/dafny_version.yml
1213
getVerifyVersion:
1314
uses: ./.github/workflows/dafny_verify_version.yml
14-
push-ci-format:
15+
# push-ci-format:
16+
# needs: getVersion
17+
# uses: ./.github/workflows/library_format.yml
18+
# with:
19+
# dafny: ${{needs.getVersion.outputs.version}}
20+
# push-ci-codegen:
21+
# needs: getVersion
22+
# uses: ./.github/workflows/ci_codegen.yml
23+
# with:
24+
# dafny: ${{needs.getVersion.outputs.version}}
25+
# push-ci-verification:
26+
# needs: getVerifyVersion
27+
# uses: ./.github/workflows/library_dafny_verification.yml
28+
# with:
29+
# dafny: ${{needs.getVerifyVersion.outputs.version}}
30+
# push-ci-test-vector-verification:
31+
# needs: getVerifyVersion
32+
# uses: ./.github/workflows/test_vector_verification.yml
33+
# with:
34+
# dafny: ${{needs.getVerifyVersion.outputs.version}}
35+
# pr-ci-java:
36+
# needs: getVersion
37+
# uses: ./.github/workflows/ci_test_java.yml
38+
# with:
39+
# dafny: ${{needs.getVersion.outputs.version}}
40+
# pr-ci-java-test-vectors:
41+
# needs: getVersion
42+
# uses: ./.github/workflows/ci_test_vector_java.yml
43+
# with:
44+
# dafny: ${{needs.getVersion.outputs.version}}
45+
# pr-ci-java-examples:
46+
# needs: getVersion
47+
# uses: ./.github/workflows/ci_examples_java.yml
48+
# with:
49+
# dafny: ${{needs.getVersion.outputs.version}}
50+
# pr-ci-net:
51+
# needs: getVersion
52+
# uses: ./.github/workflows/ci_test_net.yml
53+
# with:
54+
# dafny: ${{needs.getVersion.outputs.version}}
55+
# pr-ci-rust:
56+
# needs: getVersion
57+
# uses: ./.github/workflows/library_rust_tests.yml
58+
# with:
59+
# dafny: ${{needs.getVersion.outputs.version}}
60+
pr-ci-go:
1561
needs: getVersion
16-
uses: ./.github/workflows/library_format.yml
17-
with:
18-
dafny: ${{needs.getVersion.outputs.version}}
19-
push-ci-codegen:
20-
needs: getVersion
21-
uses: ./.github/workflows/ci_codegen.yml
22-
with:
23-
dafny: ${{needs.getVersion.outputs.version}}
24-
push-ci-verification:
25-
needs: getVerifyVersion
26-
uses: ./.github/workflows/library_dafny_verification.yml
27-
with:
28-
dafny: ${{needs.getVerifyVersion.outputs.version}}
29-
push-ci-test-vector-verification:
30-
needs: getVerifyVersion
31-
uses: ./.github/workflows/test_vector_verification.yml
32-
with:
33-
dafny: ${{needs.getVerifyVersion.outputs.version}}
34-
pr-ci-java:
35-
needs: getVersion
36-
uses: ./.github/workflows/ci_test_java.yml
37-
with:
38-
dafny: ${{needs.getVersion.outputs.version}}
39-
pr-ci-java-test-vectors:
40-
needs: getVersion
41-
uses: ./.github/workflows/ci_test_vector_java.yml
42-
with:
43-
dafny: ${{needs.getVersion.outputs.version}}
44-
pr-ci-java-examples:
45-
needs: getVersion
46-
uses: ./.github/workflows/ci_examples_java.yml
47-
with:
48-
dafny: ${{needs.getVersion.outputs.version}}
49-
pr-ci-net:
50-
needs: getVersion
51-
uses: ./.github/workflows/ci_test_net.yml
52-
with:
53-
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}}
59-
pr-ci-net-test-vectors:
60-
needs: getVersion
61-
uses: ./.github/workflows/ci_test_vector_net.yml
62-
with:
63-
dafny: ${{needs.getVersion.outputs.version}}
64-
pr-ci-net-examples:
65-
needs: getVersion
66-
uses: ./.github/workflows/ci_examples_net.yml
62+
uses: ./.github/workflows/ci_test_go.yml
6763
with:
6864
dafny: ${{needs.getVersion.outputs.version}}
65+
# pr-ci-net-test-vectors:
66+
# needs: getVersion
67+
# uses: ./.github/workflows/ci_test_vector_net.yml
68+
# with:
69+
# dafny: ${{needs.getVersion.outputs.version}}
70+
# pr-ci-net-examples:
71+
# needs: getVersion
72+
# uses: ./.github/workflows/ci_examples_net.yml
73+
# with:
74+
# dafny: ${{needs.getVersion.outputs.version}}

0 commit comments

Comments
 (0)