Skip to content

Commit d350e84

Browse files
chore(CI): add backwards compatability tests for nightly (#790)
Co-authored-by: Robin Salkeld <[email protected]>
1 parent f5f8718 commit d350e84

File tree

4 files changed

+157
-3
lines changed

4 files changed

+157
-3
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+
esdk-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:
@@ -33,3 +48,9 @@ jobs:
3348
mpl-dafny: ${{inputs.mpl-dafny}}
3449
mpl-commit: ${{inputs.mpl-commit}}
3550
esdk-dafny: ${{inputs.esdk-dafny}}
51+
dafny-nightly-go:
52+
uses: ./.github/workflows/dafny_interop_library_go_tests.yml
53+
with:
54+
mpl-dafny: ${{inputs.mpl-dafny}}
55+
mpl-commit: ${{inputs.mpl-commit}}
56+
esdk-dafny: ${{inputs.esdk-dafny}}
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
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+
esdk-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+
go-version: ["1.23"]
28+
os: [
29+
# Sed script doesn't work properly on windows
30+
# windows-latest,
31+
ubuntu-22.04,
32+
# TODO: Re-enable macOS after https://t.corp.amazon.com/P205755286
33+
# macos-13,
34+
]
35+
runs-on: ${{ matrix.os }}
36+
permissions:
37+
id-token: write
38+
contents: read
39+
steps:
40+
- name: Support longpaths on Git checkout
41+
run: |
42+
git config --global core.longpaths true
43+
- uses: actions/checkout@v3
44+
- name: Init Submodules
45+
shell: bash
46+
run: |
47+
git submodule update --init libraries
48+
git submodule update --init --recursive mpl
49+
50+
- name: Configure AWS Credentials
51+
uses: aws-actions/configure-aws-credentials@v2
52+
with:
53+
aws-region: us-west-2
54+
role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-Public-ESDK-Dafny-Role-us-west-2
55+
role-session-name: GoTests
56+
57+
- name: Setup MPL Dafny
58+
uses: ./mpl/.github/actions/setup_dafny
59+
with:
60+
dafny-version: ${{ inputs.mpl-dafny }}
61+
62+
- name: Update MPL submodule
63+
working-directory: mpl
64+
run: |
65+
git fetch
66+
git checkout ${{inputs.mpl-commit}}
67+
git pull
68+
git submodule update --init --recursive
69+
git rev-parse HEAD
70+
71+
- name: Install Smithy-Dafny codegen dependencies
72+
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
73+
74+
- name: Install Go
75+
uses: actions/setup-go@v5
76+
with:
77+
go-version: ${{ matrix.go-version }}
78+
79+
- name: Install Go imports
80+
run: |
81+
go install golang.org/x/tools/cmd/goimports@latest
82+
83+
- name: Compile MPL with Dafny ${{inputs.mpl-dafny}}
84+
shell: bash
85+
working-directory: mpl/TestVectorsAwsCryptographicMaterialProviders
86+
run: |
87+
# This works because `node` is installed by default on GHA runners
88+
CORES=$(node -e 'console.log(os.cpus().length)')
89+
make transpile_go CORES=$CORES
90+
91+
- name: Setup ESDK Dafny
92+
uses: ./mpl/.github/actions/setup_dafny
93+
with:
94+
dafny-version: ${{ inputs.esdk-dafny}}
95+
96+
- name: Build ESDK implementation
97+
shell: bash
98+
working-directory: ./${{ matrix.library }}
99+
run: |
100+
# This works because `node` is installed by default on GHA runners
101+
CORES=$(node -e 'console.log(os.cpus().length)')
102+
make transpile_go CORES=$CORES
103+
104+
- name: Test Go
105+
working-directory: ${{ matrix.library }}
106+
shell: bash
107+
run: |
108+
make test_go

.github/workflows/dafny_interop_test_vector_net.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ jobs:
235235
uses: actions/upload-artifact@v4
236236
if: matrix.os != 'windows-latest'
237237
with:
238-
name: ${{matrix.os}}_vector_artifact
238+
name: ${{matrix.os}}_mpl-${{inputs.mpl-dafny}}_esdk-${{inputs.esdk-dafny}}_vectors
239239
path: AwsEncryptionSDK/net41/vectors/*.zip
240240

241241
decrypt_net_vectors_with_js:
@@ -274,7 +274,7 @@ jobs:
274274
- name: Download Encrypt Manifest Artifact
275275
uses: actions/download-artifact@v4
276276
with:
277-
name: ${{matrix.os}}_vector_artifact
277+
name: ${{matrix.os}}_mpl-${{inputs.mpl-dafny}}_esdk-${{inputs.esdk-dafny}}_vectors
278278
path: AwsEncryptionSDK/net41/vectors
279279

280280
- uses: actions/setup-node@v4

.github/workflows/nighly_dafny.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,38 @@ jobs:
4343
with:
4444
dafny: "nightly-latest"
4545
regenerate-code: true
46+
getVersion:
47+
uses: ./.github/workflows/dafny_version.yaml
48+
dafny_nightly_backwards_interop_esdk:
49+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
50+
needs: getVersion
51+
uses: ./.github/workflows/dafny_interop.yml
52+
with:
53+
mpl-dafny: ${{needs.getVersion.outputs.version}}
54+
mpl-commit: "main"
55+
esdk-dafny: "nightly-latest"
56+
dafny_nightly_backwards_interop_mpl:
57+
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
58+
needs: getVersion
59+
uses: ./.github/workflows/dafny_interop.yml
60+
with:
61+
mpl-dafny: "nightly-latest"
62+
mpl-commit: "main"
63+
esdk-dafny: ${{needs.getVersion.outputs.version}}
4664

4765
cut-issue-on-failure:
4866
runs-on: ubuntu-22.04
4967
permissions:
5068
id-token: write
5169
contents: read
52-
needs: [dafny-nightly-verification, dafny-nightly-net]
70+
needs:
71+
[
72+
dafny-nightly-verification,
73+
dafny-nightly-net,
74+
dafny-nightly-go,
75+
dafny_nightly_backwards_interop_esdk,
76+
dafny_nightly_backwards_interop_mpl,
77+
]
5378
if: ${{ always() && contains(needs.*.result, 'failure') }}
5479
steps:
5580
# We need access to the role that is able to get CI Bot Creds

0 commit comments

Comments
 (0)