Skip to content

Commit 5499941

Browse files
committed
chore(CI): add backwards compatability tests for nightly
1 parent 7dd705b commit 5499941

File tree

3 files changed

+164
-0
lines changed

3 files changed

+164
-0
lines changed

.github/workflows/dafny-interop.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@
44
name: Dafny Interoperability Test
55

66
on:
7+
workflow_call:
8+
inputs:
9+
mpl-dafny:
10+
description: "The Dafny version to compile the MPL with (4.2.0, nightly-latest, etc..)"
11+
required: true
12+
type: string
13+
mpl-commit:
14+
description: "The MPL branch/commit to use"
15+
required: false
16+
default: "main"
17+
type: string
18+
dbesdk-dafny:
19+
description: "The Dafny version to compile the DBESDK with (4.2.0, nightly-latest, etc..)"
20+
required: true
21+
type: string
722
workflow_dispatch:
823
inputs:
924
mpl-dafny:
@@ -67,3 +82,9 @@ jobs:
6782
mpl-dafny: ${{inputs.mpl-dafny}}
6883
mpl-commit: ${{inputs.mpl-commit}}
6984
dbesdk-dafny: ${{inputs.dbesdk-dafny}}
85+
dafny-interop-go:
86+
uses: ./.github/workflows/dafny_interop_go_tests.yml
87+
with:
88+
mpl-dafny: ${{inputs.mpl-dafny}}
89+
mpl-commit: ${{inputs.mpl-commit}}
90+
dbesdk-dafny: ${{inputs.dbesdk-dafny}}
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# This workflow performs tests in Go with nightly latest versions for mpl or esdk.
2+
name: Library Go Backwards Interop Tests
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
mpl-dafny:
8+
description: "The Dafny version to compile the MPL with (4.2.0, dafny-nightly, etc..)"
9+
required: true
10+
type: string
11+
mpl-commit:
12+
description: "The MPL commit to use"
13+
required: false
14+
default: "main"
15+
type: string
16+
dbesdk-dafny:
17+
description: "The Dafny version to compile the DBESDK with (4.2.0, dafny-nightly, etc..)"
18+
required: true
19+
type: string
20+
21+
jobs:
22+
testGo:
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
library: [TestVectors]
27+
os: [ubuntu-22.04, macos-13]
28+
go-version: ["1.23", "1.24"]
29+
runs-on: ${{ matrix.os }}
30+
permissions:
31+
id-token: write
32+
contents: read
33+
steps:
34+
- name: Setup Docker
35+
if: matrix.os == 'macos-13' && matrix.library == 'TestVectors'
36+
uses: douglascamata/setup-docker-macos-action@v1-alpha
37+
38+
- name: Setup DynamoDB Local
39+
if: matrix.library == 'TestVectors'
40+
uses: rrainn/[email protected]
41+
with:
42+
port: 8000
43+
cors: "*"
44+
45+
- name: Support longpaths
46+
run: |
47+
git config --global core.longpaths true
48+
49+
- name: Configure AWS Credentials
50+
uses: aws-actions/configure-aws-credentials@v4
51+
with:
52+
aws-region: us-west-2
53+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2
54+
role-session-name: DDBEC-Dafny-Java-Tests
55+
56+
- uses: actions/checkout@v3
57+
with:
58+
submodules: recursive
59+
60+
- name: Setup MPL Dafny
61+
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny
62+
with:
63+
dafny-version: ${{ inputs.mpl-dafny }}
64+
65+
- name: Create temporary global.json
66+
run: echo '{"sdk":{"rollForward":"latestFeature","version":"6.0.0"}}' > ./global.json
67+
68+
- name: Setup Java 17 for codegen
69+
uses: actions/setup-java@v3
70+
with:
71+
distribution: "corretto"
72+
java-version: "17"
73+
74+
- name: Update MPL submodule
75+
working-directory: mpl
76+
run: |
77+
git fetch
78+
git checkout ${{inputs.mpl-commit}}
79+
git pull
80+
git submodule update --init --recursive
81+
git rev-parse HEAD
82+
83+
- uses: actions/checkout@v3
84+
- name: Init Submodules
85+
shell: bash
86+
run: |
87+
git submodule update --init --recursive submodules/smithy-dafny
88+
git submodule update --init --recursive submodules/MaterialProviders
89+
90+
- name: Install Smithy-Dafny codegen dependencies
91+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
92+
93+
- name: Install Go
94+
uses: actions/setup-go@v5
95+
with:
96+
go-version: ${{ matrix.go-version }}
97+
98+
- name: Install Go imports
99+
shell: bash
100+
run: |
101+
go install golang.org/x/tools/cmd/goimports@latest
102+
103+
- name: Compile MPL with Dafny ${{inputs.mpl-dafny}}
104+
shell: bash
105+
working-directory: submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders
106+
run: |
107+
# This works because `node` is installed by default on GHA runners
108+
CORES=$(node -e 'console.log(os.cpus().length)')
109+
make transpile_go CORES=$CORES
110+
111+
- name: Setup DBESDK Dafny
112+
uses: ./submodules/MaterialProviders/.github/actions/setup_dafny
113+
with:
114+
dafny-version: ${{ inputs.dbesdk-dafny}}
115+
116+
- name: Build DBESDK implementation
117+
shell: bash
118+
working-directory: ./${{ matrix.library }}
119+
run: |
120+
# This works because `node` is installed by default on GHA runners
121+
CORES=$(node -e 'console.log(os.cpus().length)')
122+
make transpile_go CORES=$CORES
123+
124+
- name: Test ${{ matrix.library }}
125+
working-directory: ./${{ matrix.library }}
126+
run: |
127+
make test_go

.github/workflows/nightly.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,22 @@ jobs:
6464
with:
6565
dafny: "nightly-latest"
6666
regenerate-code: true
67+
dafny_nightly_backwards_interop_dbesdk:
68+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
69+
needs: getVersion
70+
uses: ./.github/workflows/dafny-interop.yml
71+
with:
72+
mpl-dafny: ${{needs.getVersion.outputs.version}}
73+
mpl-commit: "main"
74+
dbesdk-dafny: "nightly-latest"
75+
dafny_nightly_backwards_interop_mpl:
76+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
77+
needs: getVersion
78+
uses: ./.github/workflows/dafny-interop.yml
79+
with:
80+
mpl-dafny: "nightly-latest"
81+
mpl-commit: "main"
82+
dbesdk-dafny: ${{needs.getVersion.outputs.version}}
6783

6884
cut-issue-on-failure:
6985
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)