Skip to content

Commit c6ce809

Browse files
authored
chore: fix dafny interop build steps (#1293)
1 parent df64b30 commit c6ce809

7 files changed

+62
-3
lines changed

.github/workflows/dafny-interop.yml

+10
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,33 @@ on:
2121
type: string
2222

2323
jobs:
24+
getMplHeadVersion:
25+
uses: ./.github/workflows/mpl_head_version.yml
26+
with:
27+
mpl-head: ${{inputs.mpl-commit}}
2428
dafny-interop-java:
29+
needs: getMplHeadVersion
2530
uses: ./.github/workflows/dafny_interop_java.yml
2631
with:
2732
mpl-dafny: ${{inputs.mpl-dafny}}
2833
mpl-commit: ${{inputs.mpl-commit}}
34+
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
2935
dbesdk-dafny: ${{inputs.dbesdk-dafny}}
3036
dafny-interop-java-test-vectors:
37+
needs: getMplHeadVersion
3138
uses: ./.github/workflows/dafny_interop_test_vector_java.yml
3239
with:
3340
mpl-dafny: ${{inputs.mpl-dafny}}
3441
mpl-commit: ${{inputs.mpl-commit}}
42+
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
3543
dbesdk-dafny: ${{inputs.dbesdk-dafny}}
3644
dafny-interop-java-examples:
45+
needs: getMplHeadVersion
3746
uses: ./.github/workflows/dafny_interop_examples_java.yml
3847
with:
3948
mpl-dafny: ${{inputs.mpl-dafny}}
4049
mpl-commit: ${{inputs.mpl-commit}}
50+
mpl-version: ${{needs.getMplHeadVersion.outputs.version}}
4151
dbesdk-dafny: ${{inputs.dbesdk-dafny}}
4252
dafny-interop-net:
4353
uses: ./.github/workflows/dafny_interop_test_net.yml

.github/workflows/dafny_interop_examples_java.yml

+8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
required: false
1414
default: "main"
1515
type: string
16+
mpl-version:
17+
description: "The MPL version to use"
18+
required: true
19+
type: string
1620
dbesdk-dafny:
1721
description: "The Dafny version to compile the DBESDK with (4.2.0, dafny-nightly, etc..)"
1822
required: true
@@ -74,6 +78,10 @@ jobs:
7478
with:
7579
dafny-version: ${{ inputs.dbesdk-dafny}}
7680

81+
- name: Update project.properties if using MPL HEAD
82+
run: |
83+
sed "s/mplDependencyJavaVersion=.*/mplDependencyJavaVersion=${{inputs.mpl-version}}/g" project.properties > project.properties2; mv project.properties2 project.properties
84+
7785
- name: Build implementation
7886
shell: bash
7987
working-directory: ./DynamoDbEncryption

.github/workflows/dafny_interop_java.yml

+8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
required: false
1414
default: "main"
1515
type: string
16+
mpl-version:
17+
description: "The MPL version to use"
18+
required: true
19+
type: string
1620
dbesdk-dafny:
1721
description: "The Dafny version to compile the DBESDK with (4.2.0, dafny-nightly, etc..)"
1822
required: true
@@ -74,6 +78,10 @@ jobs:
7478
with:
7579
dafny-version: ${{ inputs.dbesdk-dafny}}
7680

81+
- name: Update project.properties if using MPL HEAD
82+
run: |
83+
sed "s/mplDependencyJavaVersion=.*/mplDependencyJavaVersion=${{inputs.mpl-version}}/g" project.properties > project.properties2; mv project.properties2 project.properties
84+
7785
- name: Build ${{ matrix.library }} implementation
7886
shell: bash
7987
working-directory: ./${{ matrix.library }}

.github/workflows/dafny_interop_test_vector_java.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
required: false
1414
default: "main"
1515
type: string
16+
mpl-version:
17+
description: "The MPL version to use"
18+
required: true
19+
type: string
1620
dbesdk-dafny:
1721
description: "The Dafny version to compile the DBESDK with (4.2.0, dafny-nightly, etc..)"
1822
required: true
@@ -22,7 +26,7 @@ jobs:
2226
testJava:
2327
strategy:
2428
matrix:
25-
library: [DynamoDbEncryption, TestVectors]
29+
library: [TestVectors]
2630
java-version: [8, 11, 16, 17]
2731
os: [
2832
# Run on ubuntu image that comes pre-configured with docker
@@ -84,6 +88,18 @@ jobs:
8488
with:
8589
dafny-version: ${{ inputs.dbesdk-dafny}}
8690

91+
- name: Update project.properties if using MPL HEAD
92+
run: |
93+
sed "s/mplDependencyJavaVersion=.*/mplDependencyJavaVersion=${{inputs.mpl-version}}/g" project.properties > project.properties2; mv project.properties2 project.properties
94+
95+
- name: Build DynamoDbEncryption implementation
96+
shell: bash
97+
working-directory: DynamoDbEncryption
98+
run: |
99+
make transpile_implementation_java
100+
make transpile_test_java
101+
make mvn_local_deploy
102+
87103
- name: Build TestVectors implementation
88104
shell: bash
89105
working-directory: ${{matrix.library}}

.github/workflows/dafny_interop_test_vector_net.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
matrix:
2525
library: [TestVectors]
2626
dotnet-version: ["6.0.x"]
27-
os: [macos-12, ubuntu-latest, windows-latest]
27+
os: [ubuntu-latest]
2828
runs-on: ${{ matrix.os }}
2929
permissions:
3030
id-token: write
@@ -85,6 +85,14 @@ jobs:
8585
with:
8686
dafny-version: ${{ inputs.dbesdk-dafny}}
8787

88+
- name: Build DynamoDbEncryption implementation
89+
shell: bash
90+
working-directory: DynamoDbEncryption
91+
run: |
92+
# This works because `node` is installed by default on GHA runners
93+
make transpile_implementation_net
94+
make transpile_test_net
95+
8896
- name: Build TestVectors implementation
8997
shell: bash
9098
working-directory: ${{matrix.library}}

.github/workflows/mpl-head.yml

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
getMplHeadVersion:
1717
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
1818
uses: ./.github/workflows/mpl_head_version.yml
19+
with:
20+
mpl-head: true
1921
mpl-head-ci-format:
2022
needs: getVersion
2123
if: github.event_name != 'schedule' || github.repository_owner == 'aws'

.github/workflows/mpl_head_version.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ name: MPL HEAD Version
55

66
on:
77
workflow_call:
8+
inputs:
9+
mpl-head:
10+
description: "Using MPL HEAD?"
11+
required: true
12+
default: main
13+
type: string
814
outputs:
915
version:
1016
description: "The dafny version for verify"
@@ -19,11 +25,12 @@ jobs:
1925
- uses: actions/checkout@v4
2026
with:
2127
submodules: recursive
28+
fetch-depth: 0
2229
- name: Update MPL submodule locally if requested
2330
working-directory: submodules/MaterialProviders
2431
shell: bash
2532
run: |
26-
git checkout main
33+
git checkout ${{inputs.mpl-head}}
2734
git pull
2835
git submodule update --init --recursive
2936
git rev-parse HEAD

0 commit comments

Comments
 (0)