Skip to content

chore(CI): add backwards compatability tests for nightly #1960

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions .github/workflows/dafny-interop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@
name: Dafny Interoperability Test

on:
workflow_call:
inputs:
mpl-dafny:
description: "The Dafny version to compile the MPL with (4.2.0, nightly-latest, etc..)"
required: true
type: string
mpl-commit:
description: "The MPL branch/commit to use"
required: false
default: "main"
type: string
dbesdk-dafny:
description: "The Dafny version to compile the DBESDK with (4.2.0, nightly-latest, etc..)"
required: true
type: string
workflow_dispatch:
inputs:
mpl-dafny:
Expand Down Expand Up @@ -67,3 +82,9 @@ jobs:
mpl-dafny: ${{inputs.mpl-dafny}}
mpl-commit: ${{inputs.mpl-commit}}
dbesdk-dafny: ${{inputs.dbesdk-dafny}}
dafny-interop-go:
uses: ./.github/workflows/dafny_interop_go_tests.yml
with:
mpl-dafny: ${{inputs.mpl-dafny}}
mpl-commit: ${{inputs.mpl-commit}}
dbesdk-dafny: ${{inputs.dbesdk-dafny}}
127 changes: 127 additions & 0 deletions .github/workflows/dafny_interop_go_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# This workflow performs tests in Go with nightly latest versions for mpl or esdk.
name: Library Go Backwards Interop Tests

on:
workflow_call:
inputs:
mpl-dafny:
description: "The Dafny version to compile the MPL with (4.2.0, dafny-nightly, etc..)"
required: true
type: string
mpl-commit:
description: "The MPL commit to use"
required: false
default: "main"
type: string
dbesdk-dafny:
description: "The Dafny version to compile the DBESDK with (4.2.0, dafny-nightly, etc..)"
required: true
type: string

jobs:
testGo:
strategy:
fail-fast: false
matrix:
library: [TestVectors]
os: [ubuntu-22.04, macos-13]
go-version: ["1.23", "1.24"]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
steps:
- name: Setup Docker
if: matrix.os == 'macos-13' && matrix.library == 'TestVectors'
uses: douglascamata/setup-docker-macos-action@v1-alpha

- name: Setup DynamoDB Local
if: matrix.library == 'TestVectors'
uses: rrainn/[email protected]
with:
port: 8000
cors: "*"

- name: Support longpaths
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-DDBEC-Dafny-Role-us-west-2
role-session-name: DDBEC-Dafny-Java-Tests

- uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup MPL Dafny
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny
with:
dafny-version: ${{ inputs.mpl-dafny }}

- name: Create temporary global.json
run: echo '{"sdk":{"rollForward":"latestFeature","version":"6.0.0"}}' > ./global.json

- name: Setup Java 17 for codegen
uses: actions/setup-java@v3
with:
distribution: "corretto"
java-version: "17"

- name: Update MPL submodule
working-directory: mpl
run: |
git fetch
git checkout ${{inputs.mpl-commit}}
git pull
git submodule update --init --recursive
git rev-parse HEAD

- uses: actions/checkout@v3
- name: Init Submodules
shell: bash
run: |
git submodule update --init --recursive submodules/smithy-dafny
git submodule update --init --recursive submodules/MaterialProviders

- name: Install Smithy-Dafny codegen dependencies
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

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

- name: Compile MPL with Dafny ${{inputs.mpl-dafny}}
shell: bash
working-directory: submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders
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: Setup DBESDK Dafny
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny
with:
dafny-version: ${{ inputs.dbesdk-dafny}}

- name: Build DBESDK implementation
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_go CORES=$CORES

- name: Test ${{ matrix.library }}
working-directory: ./${{ matrix.library }}
run: |
make test_go
16 changes: 16 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ jobs:
with:
dafny: "nightly-latest"
regenerate-code: true
dafny_nightly_backwards_interop_dbesdk:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
needs: getVersion
uses: ./.github/workflows/dafny-interop.yml
with:
mpl-dafny: ${{needs.getVersion.outputs.version}}
mpl-commit: "main"
dbesdk-dafny: "nightly-latest"
dafny_nightly_backwards_interop_mpl:
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
needs: getVersion
uses: ./.github/workflows/dafny-interop.yml
with:
mpl-dafny: "nightly-latest"
mpl-commit: "main"
dbesdk-dafny: ${{needs.getVersion.outputs.version}}

cut-issue-on-failure:
runs-on: ubuntu-22.04
Expand Down
Loading