-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: merge Golang/dev branch with mainline (#704)
- Loading branch information
1 parent
2db84c0
commit 6db9ace
Showing
72 changed files
with
20,302 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,10 @@ jobs: | |
strategy: | ||
matrix: | ||
library: [ | ||
AwsEncryptionSDK | ||
AwsEncryptionSDK, | ||
TestVectors | ||
] | ||
os: [ macos-12 ] | ||
os: [ macos-13 ] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | ||
|
@@ -36,7 +37,13 @@ jobs: | |
run: | | ||
git submodule update --init libraries | ||
git submodule update --init --recursive mpl | ||
git submodule update --init smithy-dafny | ||
# dafny-reportgenerator requires next6 | ||
# but only 7.0 is installed on macos-13-large | ||
- name: Setup .NET Core SDK '6.0.x' | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: "6.0.x" | ||
|
||
- name: Setup Dafny | ||
uses: dafny-lang/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,216 @@ | ||
# This workflow performs interoperability tests across the supported runtimes of the ESDK Dafny | ||
name: Library Interoperability Dafny TestVectors | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
dafny: | ||
description: "The Dafny version to use" | ||
required: true | ||
type: string | ||
regenerate-code: | ||
description: "Regenerate code using smithy-dafny" | ||
required: false | ||
default: false | ||
type: boolean | ||
|
||
jobs: | ||
generateEncryptVectors: | ||
strategy: | ||
matrix: | ||
library: [TestVectors] | ||
os: [ | ||
# https://taskei.amazon.dev/tasks/CrypTool-5283 | ||
# windows-latest, | ||
ubuntu-latest, | ||
macos-13, | ||
] | ||
language: [java, net] | ||
# https://taskei.amazon.dev/tasks/CrypTool-5284 | ||
dotnet-version: ["6.0.x"] | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
steps: | ||
- name: Support longpaths on Git checkout | ||
run: | | ||
git config --global core.longpaths true | ||
- uses: actions/checkout@v3 | ||
# Not all submodules are needed. | ||
# We manually pull the submodule we DO need. | ||
- run: git submodule update --init libraries | ||
- run: git submodule update --init --recursive mpl | ||
|
||
# Set up runtimes | ||
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }} | ||
if: matrix.language == 'net' | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ matrix.dotnet-version }} | ||
|
||
- name: Setup Java 17 | ||
if: matrix.language == 'java' | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "corretto" | ||
java-version: 17 | ||
|
||
- name: Setup Dafny | ||
uses: dafny-lang/[email protected] | ||
with: | ||
dafny-version: ${{ inputs.dafny }} | ||
|
||
- name: Regenerate code using smithy-dafny if necessary | ||
if: ${{ inputs.regenerate-code }} | ||
uses: ./.github/actions/polymorph_codegen | ||
with: | ||
dafny: ${{ inputs.dafny }} | ||
library: ${{ matrix.library }} | ||
diff-generated-code: false | ||
|
||
# Build implementation for each runtime | ||
- name: Build ${{ matrix.library }} implementation in Java | ||
if: matrix.language == 'java' | ||
shell: bash | ||
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 build_java CORES=$CORES | ||
- name: Build ${{ matrix.library }} implementation in .NET | ||
if: matrix.language == 'net' | ||
shell: bash | ||
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_net | ||
- name: Setup gradle | ||
if: matrix.language == 'java' | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-version: 7.2 | ||
|
||
# TestVectors will call KMS | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-region: us-west-2 | ||
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2 | ||
role-session-name: InterOpTests | ||
|
||
- name: Create Manifests | ||
working-directory: ./${{ matrix.library }} | ||
run: make test_generate_vectors_${{ matrix.language }} | ||
|
||
- name: Create Encrypt Manifests | ||
working-directory: ./${{ matrix.library }} | ||
run: make test_encrypt_vectors_${{ matrix.language }} | ||
|
||
- name: Upload Encrypt Manifest and keys.json files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{matrix.os}}_vector_artifact_${{matrix.language}}_${{github.sha}} | ||
path: | | ||
./${{matrix.library}}/runtimes/${{matrix.language}}/*.json | ||
./${{matrix.library}}/runtimes/${{matrix.language}}/plaintexts | ||
./${{matrix.library}}/runtimes/${{matrix.language}}/ciphertexts | ||
testInteroperablity: | ||
needs: generateEncryptVectors | ||
strategy: | ||
matrix: | ||
library: [TestVectors] | ||
os: [ | ||
# https://taskei.amazon.dev/tasks/CrypTool-5283 | ||
# windows-latest, | ||
ubuntu-latest, | ||
macos-13, | ||
] | ||
encrypting_language: [java, net] | ||
decrypting_language: [java, net] | ||
# https://taskei.amazon.dev/tasks/CrypTool-5284 | ||
dotnet-version: ["6.0.x"] | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
steps: | ||
- name: Support longpaths on Git checkout | ||
run: | | ||
git config --global core.longpaths true | ||
# TestVectors will call KMS | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-region: us-west-2 | ||
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2 | ||
role-session-name: InterOpTests | ||
|
||
- uses: actions/checkout@v3 | ||
# Not all submodules are needed. | ||
# We manually pull the submodule we DO need. | ||
- run: git submodule update --init libraries | ||
- run: git submodule update --init --recursive mpl | ||
|
||
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }} | ||
if: matrix.decrypting_language == 'net' | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ matrix.dotnet-version }} | ||
|
||
- name: Setup Java 17 | ||
if: matrix.decrypting_language == 'java' | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "corretto" | ||
java-version: 17 | ||
|
||
- name: Setup Dafny | ||
uses: dafny-lang/[email protected] | ||
with: | ||
dafny-version: ${{ inputs.dafny }} | ||
|
||
- name: Regenerate code using smithy-dafny if necessary | ||
if: ${{ inputs.regenerate-code }} | ||
uses: ./.github/actions/polymorph_codegen | ||
with: | ||
dafny: ${{ inputs.dafny }} | ||
library: ${{ matrix.library }} | ||
diff-generated-code: false | ||
|
||
# Build implementation for each runtime | ||
- name: Build ${{ matrix.library }} implementation in Java | ||
if: matrix.decrypting_language == 'java' | ||
working-directory: ./${{ matrix.library }} | ||
shell: bash | ||
run: | | ||
# This works because `node` is installed by default on GHA runners | ||
CORES=$(node -e 'console.log(os.cpus().length)') | ||
make build_java CORES=$CORES | ||
- name: Build ${{ matrix.library }} implementation in .NET | ||
if: matrix.decrypting_language == 'net' | ||
working-directory: ./${{ matrix.library }} | ||
shell: bash | ||
run: | | ||
# This works because `node` is installed by default on GHA runners | ||
CORES=$(node -e 'console.log(os.cpus().length)') | ||
make transpile_net | ||
- name: Download Encrypt Manifest Artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{matrix.os}}_vector_artifact_${{matrix.encrypting_language}}_${{github.sha}} | ||
path: ./${{matrix.library}}/runtimes/${{matrix.decrypting_language}} | ||
|
||
- name: Decrypt Encrypt Manifest | ||
working-directory: ./${{ matrix.library }} | ||
run: make test_decrypt_encrypt_vectors_${{matrix.decrypting_language}} | ||
|
Oops, something went wrong.