Skip to content

Commit af1e677

Browse files
chore(CI): Add a diff check for polymorph in CI (#738)
1 parent d580c4a commit af1e677

File tree

5 files changed

+77
-1
lines changed
  • .github
  • AwsEncryptionSDK/runtimes/go
    • ImplementationFromDafny-go/WrappedAwsCryptographyEncryptionSdkService
    • TestsFromDafny-go/awscryptographyencryptionsdksmithygeneratedtypes
    • examples

5 files changed

+77
-1
lines changed

.github/actions/polymorph_codegen/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ runs:
116116
# run: |
117117
# make polymorph_rust ${{ steps.dependencies.outputs.PROJECT_DEPENDENCIES }}
118118

119+
- name: Regenerate Go code using smithy-dafny
120+
working-directory: ./${{ inputs.library }}
121+
shell: bash
122+
run: |
123+
make polymorph_go
124+
119125
- name: Check regenerated code against commited code
120126
# Composite action inputs seem to not actually support booleans properly for some reason
121127
if: inputs.diff-generated-code == 'true'

.github/workflows/library_codegen.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
# Note dotnet is only used for formatting generated code
2121
# in this workflow
2222
dotnet-version: ["6.0.x"]
23+
go-version: [1.23]
2324
os: [ubuntu-latest]
2425
runs-on: ${{ matrix.os }}
2526
defaults:
@@ -61,6 +62,15 @@ jobs:
6162
- name: Install Smithy-Dafny codegen dependencies
6263
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
6364

65+
- name: Install Go
66+
uses: actions/setup-go@v5
67+
with:
68+
go-version: ${{ matrix.go-version }}
69+
70+
- name: Install Go imports
71+
run: |
72+
go install golang.org/x/tools/cmd/goimports@latest
73+
6474
- uses: ./.github/actions/polymorph_codegen
6575
with:
6676
dafny: ${{ env.DAFNY_VERSION }}

AwsEncryptionSDK/runtimes/go/ImplementationFromDafny-go/WrappedAwsCryptographyEncryptionSdkService/shim.go

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AwsEncryptionSDK/runtimes/go/TestsFromDafny-go/awscryptographyencryptionsdksmithygeneratedtypes/enums.go

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AwsEncryptionSDK/runtimes/go/examples/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import (
2222
"github.com/aws/aws-encryption-sdk-dafny/releases/go/encryption-sdk/examples/keyring/multikeyring"
2323
"github.com/aws/aws-encryption-sdk-dafny/releases/go/encryption-sdk/examples/keyring/rawaeskeyring"
2424
"github.com/aws/aws-encryption-sdk-dafny/releases/go/encryption-sdk/examples/keyring/rawrsakeyring"
25-
"github.com/aws/aws-encryption-sdk-dafny/releases/go/encryption-sdk/examples/multithreading"
2625
"github.com/aws/aws-encryption-sdk-dafny/releases/go/encryption-sdk/examples/misc"
26+
"github.com/aws/aws-encryption-sdk-dafny/releases/go/encryption-sdk/examples/multithreading"
2727
"github.com/aws/aws-encryption-sdk-dafny/releases/go/encryption-sdk/examples/utils"
2828
)
2929

0 commit comments

Comments
 (0)