Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Golang/dev #1060

Draft
wants to merge 43 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d375148
Impl: StdLib Externs
Sep 13, 2024
49cd35a
feat: StdLib Externs gofmt
Sep 13, 2024
f09511d
Merge branch 'main' into scchatur/Go
Sep 23, 2024
5007944
Impl: Primitives Extern
Sep 23, 2024
bd61bc8
Impl: Kms Extern
Sep 23, 2024
f8fd3fb
Impl: Dynamodb Extern
Sep 23, 2024
da5a83b
fix: format Kms Extern
Sep 23, 2024
03fad04
Impl: Externs
Sep 27, 2024
00e8137
Fix: add go.mod files for mpl
Sep 27, 2024
5fd7d77
Fix(submodule): Update submodules
Sep 27, 2024
833ac1f
Fix(go.mod): Use submodule DafnyRuntimeGo
Sep 27, 2024
e961753
Impl(partial): Cache externs
Sep 27, 2024
21a6dcc
Merge branch 'main' into scchatur/Go
ShubhamChaturvedi7 Sep 27, 2024
be7c58e
(fix): ESDK Testing Fixes
Oct 11, 2024
e271548
Merge branch 'main' into Golang/dev
Oct 14, 2024
f6ecf5d
(fix): Use DafnyRuntimeGo v4
Oct 14, 2024
42af276
fix(H-Keyring): if getCache returns Error not EntryDoesNotExist, erro…
texastony Oct 11, 2024
a67ce58
fix(Python): Repolymorph to add orphaned shapes (#831)
lucasmcdonald3 Oct 11, 2024
8ef5ae4
chore(Python): Fetch tags as part of release (#858)
lucasmcdonald3 Oct 12, 2024
3710153
fix(H-Keyring): if putCache throws EntryAlreadyExists, swallow (#856)
texastony Oct 12, 2024
1a532c9
chore(release): 1.7.1 [skip ci] (#857)
lucasmcdonald3 Oct 14, 2024
5e0380b
chore(CI): Allow local testing (#859)
lucasmcdonald3 Oct 14, 2024
b0125b7
Merge branch 'main' into Golang/dev
Oct 21, 2024
caa6810
Merge branch 'main' into Golang/dev
Oct 22, 2024
a3213d7
feat: Use CI verified smithy-dafny
Oct 22, 2024
cbb5a40
feat: Add CI stub
Oct 22, 2024
7bebd00
fix: Use Dafny 4.8
Oct 29, 2024
7a598b6
feat: check-in polymorph_go for kms
Oct 29, 2024
58ccfd6
feat: check-in polymorph_go for ddbv2
Oct 29, 2024
386d7ce
feat: check-in polymorph_go for primitives
Oct 29, 2024
a8358c7
feat: check-in polymorph_go for mpl
Oct 29, 2024
94ca40c
fix: kms go.sum
Oct 29, 2024
3d10e79
fix: Revert v2 to v1 and add new v2
Oct 31, 2024
18431de
Merge branch 'main' into Golang/dev
Nov 1, 2024
71cf953
feat: main merge
Nov 6, 2024
01bfe1e
fix: kms bugs
Nov 7, 2024
53f2bbd
fix: ddb bugs
Nov 7, 2024
3b2887c
fix: primitives bugs
Nov 7, 2024
dd31cbb
feat: Golang
Nov 14, 2024
5c8dd62
feat: Golang
Nov 14, 2024
31842a1
fix: return Native Hash Algorithm instead of signature algorithm
rishav-karanjit Nov 27, 2024
15fbe4e
Merge branch 'main' into Golang/dev
Nov 27, 2024
2449f19
fix: DafnyLibraries.FileIO extern
Dec 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .github/workflows/library_go_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# This workflow performs tests in Go.
name: Library Go tests

on:
workflow_call:
inputs:
dafny:
description: "The Dafny version to run"
required: true
type: string
regenerate-code:
description: "Regenerate code using smithy-dafny"
required: false
default: false
type: boolean

jobs:
testGo:
strategy:
fail-fast: false
matrix:
library:
[
StandardLibrary,
AwsCryptographyPrimitives,
ComAmazonawsKms,
ComAmazonawsDynamodb,
AwsCryptographicMaterialProviders,
TestVectorsAwsCryptographicMaterialProviders,
]
go-version: ["1.23"]
os: [
# TODO fix Dafny-generated tests on Windows;
# the sys.path workaround for generated Dafny doesn't work on Windows.
# Note: only tests use the sys.path workaround, not source code.
# Windows source code is tested downstream (ex. ESDK-Go CI).
# windows-latest,
ubuntu-latest,
macos-12,
]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
permissions:
id-token: write
contents: read
steps:
- name: Support longpaths on Git checkout
run: |
git config --global core.longpaths true

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-MPL-Dafny-Role-us-west-2
role-session-name: GoTests

- uses: actions/checkout@v4
# The specification submodule is private so we don't have access, but we don't need
# it to verify the Dafny code. Instead we manually pull the submodules we DO need.
- run: git submodule update --init libraries
- run: git submodule update --init smithy-dafny

# TODO: This is still in nighlty
- name: Setup Dafny
uses: dafny-lang/[email protected]
with:
dafny-version: "nightly-latest"

- name: Setup Go ${{ matrix.go-version }} for running tests
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Install Go imports
run: |
go install golang.org/x/tools/cmd/goimports@latest

- name: Build ${{ matrix.library }} implementation
working-directory: ./${{ matrix.library }}
run: |
# This works because `node` is installed by default on GHA runners
CORES=$(node -e 'console.log(os.cpus().length)')
make transpile_go CORES=$CORES

- name: Test ${{ matrix.library }}
working-directory: ./${{ matrix.library }}
shell: bash
run: |
make test_go
4 changes: 3 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[submodule "libraries"]
path = libraries
url = https://github.com/dafny-lang/libraries.git
url = https://github.com/dafny-lang/libraries.git
branch = Golang/dev
[submodule "smithy-dafny"]
path = smithy-dafny
url = https://[email protected]/smithy-lang/smithy-dafny.git
branch = Golang/dev
[submodule "aws-encryption-sdk-specification"]
path = aws-encryption-sdk-specification
url = https://github.com/awslabs/aws-encryption-sdk-specification.git
17 changes: 16 additions & 1 deletion AwsCryptographicMaterialProviders/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# SPDX-License-Identifier: Apache-2.0

CORES=2

ENABLE_EXTERN_PROCESSING=1

include ../SharedMakefileV2.mk
Expand Down Expand Up @@ -68,6 +67,22 @@ SERVICE_DEPS_AwsCryptographyKeyStore := \
ComAmazonawsDynamodb \
AwsCryptographicMaterialProviders/dafny/AwsCryptographicMaterialProviders \

GO_MODULE_NAME="github.com/aws/aws-cryptographic-material-providers-library/mpl"

GO_DEPENDENCY_MODULE_NAMES := \
--dependency-library-name=com.amazonaws.dynamodb=github.com/aws/aws-cryptographic-material-providers-library/dynamodb \
--dependency-library-name=com.amazonaws.kms=github.com/aws/aws-cryptographic-material-providers-library/kms \
--dependency-library-name=aws.cryptography.keyStore=github.com/aws/aws-cryptographic-material-providers-library/mpl \
--dependency-library-name=aws.cryptography.primitives=github.com/aws/aws-cryptographic-material-providers-library/primitives \
--dependency-library-name=sdk.com.amazonaws.dynamodb=github.com/aws/aws-sdk-go-v2/service/dynamodb \
--dependency-library-name=sdk.com.amazonaws.kms=github.com/aws/aws-sdk-go-v2/service/kms

TRANSLATION_RECORD_GO := \
StandardLibrary/runtimes/go/ImplementationFromDafny-go/ImplementationFromDafny-go.dtr \
ComAmazonawsKms/runtimes/go/ImplementationFromDafny-go/ImplementationFromDafny-go.dtr \
ComAmazonawsDynamodb/runtimes/go/ImplementationFromDafny-go/ImplementationFromDafny-go.dtr \
AwsCryptographyPrimitives/runtimes/go/ImplementationFromDafny-go/ImplementationFromDafny-go.dtr

# Constants for languages that drop extern names (Python, Go)

MPL_CORE_TYPES_FILE_PATH=dafny/AwsCryptographicMaterialProviders/Model/AwsCryptographyMaterialProvidersTypes.dfy
Expand Down
Loading
Loading