From 50a4f2363fc30b7e20a41ac0d5cac34381cd3912 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 17 Oct 2024 15:47:15 -0700 Subject: [PATCH 1/9] Install smithy-dafny dependencies before codegen --- .github/actions/polymorph_codegen/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml index 7f6b4f29b..736f1d940 100644 --- a/.github/actions/polymorph_codegen/action.yml +++ b/.github/actions/polymorph_codegen/action.yml @@ -57,6 +57,12 @@ inputs: runs: using: "composite" steps: + - name: Install smithy-dafny dependencies + shell: bash + working-directory: smithy-dafny + run: | + make mvn_local_deploy_polymorph_dependencies + - name: Update MPL submodule locally if requested if: inputs.update-and-regenerate-mpl == 'true' shell: bash From 8925f4b433cc9f9e20ef50a95e3457a4e2b1bdc2 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Thu, 17 Oct 2024 15:59:24 -0700 Subject: [PATCH 2/9] =?UTF-8?q?Missing=20=E2=80=94recursive=20when=20initi?= =?UTF-8?q?ng=20smithy-dafny=20submodule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dafny_interop_test_vector_net.yml | 2 +- .github/workflows/library_dafny_verification.yml | 2 +- .github/workflows/library_interop_tests.yml | 6 +++--- .github/workflows/library_java_tests.yml | 2 +- .github/workflows/library_net_tests.yml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dafny_interop_test_vector_net.yml b/.github/workflows/dafny_interop_test_vector_net.yml index 2940a1a67..26bd5a77a 100644 --- a/.github/workflows/dafny_interop_test_vector_net.yml +++ b/.github/workflows/dafny_interop_test_vector_net.yml @@ -267,7 +267,7 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - git submodule update --init smithy-dafny + git submodule update --init --recursive smithy-dafny - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 diff --git a/.github/workflows/library_dafny_verification.yml b/.github/workflows/library_dafny_verification.yml index f36a30347..eb89d26c9 100644 --- a/.github/workflows/library_dafny_verification.yml +++ b/.github/workflows/library_dafny_verification.yml @@ -36,7 +36,7 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - git submodule update --init smithy-dafny + git submodule update --init --recursive smithy-dafny - name: Setup Dafny uses: dafny-lang/setup-dafny-action@v1.7.0 diff --git a/.github/workflows/library_interop_tests.yml b/.github/workflows/library_interop_tests.yml index 112b6825a..dfd76159a 100644 --- a/.github/workflows/library_interop_tests.yml +++ b/.github/workflows/library_interop_tests.yml @@ -46,7 +46,7 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - git submodule update --init smithy-dafny + git submodule update --init --recursive smithy-dafny - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 @@ -144,7 +144,7 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - git submodule update --init smithy-dafny + git submodule update --init --recursive smithy-dafny - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 @@ -246,7 +246,7 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - git submodule update --init smithy-dafny + git submodule update --init --recursive smithy-dafny - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 diff --git a/.github/workflows/library_java_tests.yml b/.github/workflows/library_java_tests.yml index 101a6223a..b0b3574df 100644 --- a/.github/workflows/library_java_tests.yml +++ b/.github/workflows/library_java_tests.yml @@ -41,7 +41,7 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - git submodule update --init smithy-dafny + git submodule update --init --recursive smithy-dafny - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 diff --git a/.github/workflows/library_net_tests.yml b/.github/workflows/library_net_tests.yml index 910f5200f..d1e0d224e 100644 --- a/.github/workflows/library_net_tests.yml +++ b/.github/workflows/library_net_tests.yml @@ -52,7 +52,7 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - git submodule update --init smithy-dafny + git submodule update --init --recursive smithy-dafny - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 From 892b4d901e682e982ee83c066a6e4b9e6ced623f Mon Sep 17 00:00:00 2001 From: Alex Chew Date: Fri, 18 Oct 2024 09:58:07 -0700 Subject: [PATCH 3/9] install Java 17 for polymorph_codegen action --- .github/actions/polymorph_codegen/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml index 736f1d940..48d7211f6 100644 --- a/.github/actions/polymorph_codegen/action.yml +++ b/.github/actions/polymorph_codegen/action.yml @@ -57,6 +57,12 @@ inputs: runs: using: "composite" steps: + - name: Setup Java 17 for codegen + uses: actions/setup-java@v4 + with: + distribution: "corretto" + java-version: "17" + - name: Install smithy-dafny dependencies shell: bash working-directory: smithy-dafny From 55be207b9ba958d9eefdbd1f35a2688e226a4b3c Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Mon, 9 Jun 2025 17:10:01 -0700 Subject: [PATCH 4/9] More dependencies --- .../action.yml | 42 +++++++++++++++---- .github/actions/polymorph_codegen/action.yml | 6 --- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/.github/actions/install_smithy_dafny_codegen_dependencies/action.yml b/.github/actions/install_smithy_dafny_codegen_dependencies/action.yml index da00a4c70..458d1640c 100644 --- a/.github/actions/install_smithy_dafny_codegen_dependencies/action.yml +++ b/.github/actions/install_smithy_dafny_codegen_dependencies/action.yml @@ -8,14 +8,40 @@ description: "Install Java package dependencies required to run Smithy-Dafny cod runs: using: "composite" steps: - - name: Install smithy-dafny-codegen Rust dependencies locally - uses: gradle/gradle-build-action@v2 + - name: Setup Java 17 for codegen + uses: actions/setup-java@v3 with: - arguments: :codegen-client:pTML :codegen-core:pTML :rust-runtime:pTML - build-root-directory: smithy-dafny/smithy-dafny-codegen-modules/smithy-rs + distribution: "corretto" + java-version: "17" - - name: Install smithy-dafny-codegen Python dependencies locally - uses: gradle/gradle-build-action@v2 + - name: Install smithy-dafny-codegen dependencies locally + shell: bash + run: | + make -C smithy-dafny mvn_local_deploy_polymorph_dependencies + + - name: Setup Python, black, and docformatter for code formatting + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + - shell: bash + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade black + python -m pip install --upgrade docformatter + + - name: Install Go + uses: actions/setup-go@v5 with: - arguments: :smithy-python-codegen:pTML - build-root-directory: smithy-dafny/codegen/smithy-dafny-codegen-modules/smithy-python/codegen + go-version: "1.23" + + - name: Install Go imports + shell: bash + run: | + go install golang.org/x/tools/cmd/goimports@latest + + # Without this the if-dafny-at-least command includes "Downloading ..." output + - name: Arbitrary makefile target to force downloading Gradle + shell: bash + run: | + make -C StandardLibrary setup_net \ No newline at end of file diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml index 48d7211f6..736f1d940 100644 --- a/.github/actions/polymorph_codegen/action.yml +++ b/.github/actions/polymorph_codegen/action.yml @@ -57,12 +57,6 @@ inputs: runs: using: "composite" steps: - - name: Setup Java 17 for codegen - uses: actions/setup-java@v4 - with: - distribution: "corretto" - java-version: "17" - - name: Install smithy-dafny dependencies shell: bash working-directory: smithy-dafny From 1c61f84003e4ed7b72b2a191925b9be2588fbc7f Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Tue, 10 Jun 2025 10:52:14 -0700 Subject: [PATCH 5/9] No more smithy-dafny submodule --- .github/workflows/dafny_interop_test_vector_net.yml | 1 - .github/workflows/library_dafny_verification.yml | 1 - .github/workflows/library_interop_tests.yml | 3 --- .github/workflows/library_java_tests.yml | 1 - .github/workflows/library_net_tests.yml | 1 - 5 files changed, 7 deletions(-) diff --git a/.github/workflows/dafny_interop_test_vector_net.yml b/.github/workflows/dafny_interop_test_vector_net.yml index 18ec1a921..c1789ca11 100644 --- a/.github/workflows/dafny_interop_test_vector_net.yml +++ b/.github/workflows/dafny_interop_test_vector_net.yml @@ -257,7 +257,6 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - git submodule update --init --recursive smithy-dafny - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 diff --git a/.github/workflows/library_dafny_verification.yml b/.github/workflows/library_dafny_verification.yml index 0ca2cf103..6f94c7eb2 100644 --- a/.github/workflows/library_dafny_verification.yml +++ b/.github/workflows/library_dafny_verification.yml @@ -34,7 +34,6 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - git submodule update --init --recursive smithy-dafny # dafny-reportgenerator requires next6 # but only 7.0 is installed on macos-13-large diff --git a/.github/workflows/library_interop_tests.yml b/.github/workflows/library_interop_tests.yml index d5c6a72c0..2b4bc065c 100644 --- a/.github/workflows/library_interop_tests.yml +++ b/.github/workflows/library_interop_tests.yml @@ -47,7 +47,6 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - git submodule update --init --recursive smithy-dafny - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 @@ -146,7 +145,6 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - git submodule update --init --recursive smithy-dafny - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 @@ -246,7 +244,6 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - git submodule update --init --recursive smithy-dafny - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 diff --git a/.github/workflows/library_java_tests.yml b/.github/workflows/library_java_tests.yml index b096912d5..4ab45937d 100644 --- a/.github/workflows/library_java_tests.yml +++ b/.github/workflows/library_java_tests.yml @@ -40,7 +40,6 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - git submodule update --init --recursive smithy-dafny - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 diff --git a/.github/workflows/library_net_tests.yml b/.github/workflows/library_net_tests.yml index 989a594e6..9d52ed845 100644 --- a/.github/workflows/library_net_tests.yml +++ b/.github/workflows/library_net_tests.yml @@ -54,7 +54,6 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - git submodule update --init --recursive smithy-dafny - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 From a9eda7640957a40eb2b149610198204d692094e3 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Tue, 10 Jun 2025 10:55:39 -0700 Subject: [PATCH 6/9] Format --- .github/workflows/dafny_interop_test_vector_net.yml | 2 +- .github/workflows/library_interop_tests.yml | 6 +++--- .github/workflows/library_net_tests.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dafny_interop_test_vector_net.yml b/.github/workflows/dafny_interop_test_vector_net.yml index c1789ca11..ed8b367c0 100644 --- a/.github/workflows/dafny_interop_test_vector_net.yml +++ b/.github/workflows/dafny_interop_test_vector_net.yml @@ -257,7 +257,7 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: diff --git a/.github/workflows/library_interop_tests.yml b/.github/workflows/library_interop_tests.yml index 2b4bc065c..700bb5440 100644 --- a/.github/workflows/library_interop_tests.yml +++ b/.github/workflows/library_interop_tests.yml @@ -47,7 +47,7 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: @@ -145,7 +145,7 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: @@ -244,7 +244,7 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4 with: diff --git a/.github/workflows/library_net_tests.yml b/.github/workflows/library_net_tests.yml index 9d52ed845..9ac9a7211 100644 --- a/.github/workflows/library_net_tests.yml +++ b/.github/workflows/library_net_tests.yml @@ -54,7 +54,7 @@ jobs: run: | git submodule update --init libraries git submodule update --init --recursive mpl - + - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v2 with: From df53d2a734efc0bc64fce82ae24c6bbaf654a7d7 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Tue, 10 Jun 2025 10:58:42 -0700 Subject: [PATCH 7/9] Fix path --- .../install_smithy_dafny_codegen_dependencies/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/install_smithy_dafny_codegen_dependencies/action.yml b/.github/actions/install_smithy_dafny_codegen_dependencies/action.yml index 60763a877..d7900e05f 100644 --- a/.github/actions/install_smithy_dafny_codegen_dependencies/action.yml +++ b/.github/actions/install_smithy_dafny_codegen_dependencies/action.yml @@ -17,7 +17,7 @@ runs: - name: Install smithy-dafny-codegen dependencies locally shell: bash run: | - make -C smithy-dafny mvn_local_deploy_polymorph_dependencies + make -C mpl/smithy-dafny mvn_local_deploy_polymorph_dependencies - name: Setup Python, black, and docformatter for code formatting uses: actions/setup-python@v4 From 1bfe41ce34814101fe31276509db5eade91ebdc5 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Tue, 10 Jun 2025 11:15:10 -0700 Subject: [PATCH 8/9] Fix path --- .github/actions/polymorph_codegen/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/polymorph_codegen/action.yml b/.github/actions/polymorph_codegen/action.yml index 62e9c51bd..c43cc1b5c 100644 --- a/.github/actions/polymorph_codegen/action.yml +++ b/.github/actions/polymorph_codegen/action.yml @@ -59,7 +59,7 @@ runs: steps: - name: Install smithy-dafny dependencies shell: bash - working-directory: smithy-dafny + working-directory: mpl/smithy-dafny run: | make mvn_local_deploy_polymorph_dependencies From f71537e4b6474933f2397e0b3b05c11d4b0ddcc5 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Tue, 10 Jun 2025 15:39:44 -0700 Subject: [PATCH 9/9] m --- .github/workflows/library_java_tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/library_java_tests.yml b/.github/workflows/library_java_tests.yml index 4ab45937d..80c3b7d68 100644 --- a/.github/workflows/library_java_tests.yml +++ b/.github/workflows/library_java_tests.yml @@ -54,7 +54,6 @@ jobs: dafny-version: ${{ inputs.dafny }} - name: Install Smithy-Dafny codegen dependencies - if: ${{ inputs.regenerate-code }} uses: ./.github/actions/install_smithy_dafny_codegen_dependencies - name: Regenerate code using smithy-dafny if necessary