From fdbe639b3d99b1fa6019674b5d394580b19a4a29 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Mon, 9 Oct 2023 13:27:04 -0400 Subject: [PATCH 01/23] chore: add release checks --- .github/workflows/changelog-verification.yml | 2 +- .github/workflows/continuous-integration.yml | 12 +++---- .github/workflows/lint.yml | 2 +- .github/workflows/release-check.yml | 35 ++++++++++++++++++++ build.gradle.kts | 5 --- gradle/libs.versions.toml | 2 +- settings.gradle.kts | 7 ++++ 7 files changed, 51 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/release-check.yml diff --git a/.github/workflows/changelog-verification.yml b/.github/workflows/changelog-verification.yml index 547b155abf8..1d6a87b038f 100644 --- a/.github/workflows/changelog-verification.yml +++ b/.github/workflows/changelog-verification.yml @@ -9,7 +9,7 @@ jobs: changelog-verification: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Check for changelog entry if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-changelog') }} run: | diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 18e884cc3e7..88fc412f126 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -22,8 +22,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 - - uses: actions/cache@v2 + uses: actions/checkout@v4 + - uses: actions/cache@v3 with: path: | ~/.gradle/caches @@ -42,8 +42,8 @@ jobs: runs-on: macos-latest steps: - name: Checkout sources - uses: actions/checkout@v2 - - uses: actions/cache@v2 + uses: actions/checkout@v4 + - uses: actions/cache@v3 with: path: | ~/.gradle/caches @@ -62,8 +62,8 @@ jobs: runs-on: windows-2019 steps: - name: Checkout sources - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 + uses: actions/checkout@v4 + - uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: '11' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b8857792238..ae9d88579d7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Lint ${{ env.PACKAGE_NAME }} run: | ./gradlew ktlint diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml new file mode 100644 index 00000000000..ffc95a3131e --- /dev/null +++ b/.github/workflows/release-check.yml @@ -0,0 +1,35 @@ +name: Release Checks + +on: + pull_request: + types: [ opened, synchronize, reopened ] + branches: [ main ] + +jobs: + release-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Check for snapshot versions + run: | + # We aren't releasable if we (1) directly depend on a snapshot version of a dependency OR (2) can't build the project without unreleased changes + if grep -q -i snapshot ./gradle/libs.versions.toml; then + echo "::error ::found snapshot version in libs.versions.toml" + exit 1 + fi + - name: Build check + run: | + # Our CI is implemented as a "live at HEAD" model where we build against the latest of all our 1P deps (either + # main branch or matching branch name). Double check that without this "live at HEAD" mode we still build + # successfully (which is how it is built during release). + # This should help prevent the cases where we forgot to bump smithy-kotlin versions and don't catch it + # because CI is masking it + ./gradlew test jvmTest \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 70c6d303d08..6ea2e149b83 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,11 +29,6 @@ plugins { apply(plugin = "aws.sdk.kotlin.kmp") allprojects { - repositories { - mavenLocal() - mavenCentral() - } - tasks.withType().configureEach { val sdkVersion: String by project moduleVersion.set(sdkVersion) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index abebf713d28..4e804b3a9c6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,7 @@ coroutines-version = "1.7.3" atomicfu-version = "0.19.0" # smithy-kotlin codegen and runtime are versioned together -smithy-kotlin-version = "0.27.6" +smithy-kotlin-version = "0.27.6-SNAPSHOT" # codegen smithy-version = "1.39.0" diff --git a/settings.gradle.kts b/settings.gradle.kts index 98fc80a8a9a..13c30b4def6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -18,6 +18,13 @@ pluginManagement { } } +dependencyResolutionManagement { + repositories { + mavenLocal() + mavenCentral() + } +} + sourceControl { gitRepository(java.net.URI("https://github.com/awslabs/aws-kotlin-repo-tools.git")) { producesModule("aws.sdk.kotlin:build-plugins") From 550950fda5abf608ddbb59ff91a6aa08c3a61229 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Mon, 9 Oct 2023 13:33:51 -0400 Subject: [PATCH 02/23] revert snapshot test --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4e804b3a9c6..abebf713d28 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,7 +7,7 @@ coroutines-version = "1.7.3" atomicfu-version = "0.19.0" # smithy-kotlin codegen and runtime are versioned together -smithy-kotlin-version = "0.27.6-SNAPSHOT" +smithy-kotlin-version = "0.27.6" # codegen smithy-version = "1.39.0" From fdb19bb5b15a981511e4a032b2a4e6b6d422784c Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Mon, 9 Oct 2023 14:05:16 -0400 Subject: [PATCH 03/23] add concurrency protections --- .github/scripts/run-codebuild-batch-job.sh | 1 + .github/workflows/codebuild-ci.yml | 25 ++++++++++++++++++++ .github/workflows/continuous-integration.yml | 5 ++++ .github/workflows/release-check.yml | 5 ++++ 4 files changed, 36 insertions(+) diff --git a/.github/scripts/run-codebuild-batch-job.sh b/.github/scripts/run-codebuild-batch-job.sh index 485045a2ebf..52d5de63bd2 100755 --- a/.github/scripts/run-codebuild-batch-job.sh +++ b/.github/scripts/run-codebuild-batch-job.sh @@ -30,6 +30,7 @@ fi BUILD_ID=$(echo ${START_RESULT} | jq '.buildBatch.id' -r) echo "Build id $BUILD_ID" +echo "aws-build-id=$BUILD_ID" >> "$GITHUB_OUTPUT" BUILD_STATUS="IN_PROGRESS" while [ "$BUILD_STATUS" == "IN_PROGRESS" ]; do diff --git a/.github/workflows/codebuild-ci.yml b/.github/workflows/codebuild-ci.yml index c1748a748ce..9352c088989 100644 --- a/.github/workflows/codebuild-ci.yml +++ b/.github/workflows/codebuild-ci.yml @@ -10,6 +10,11 @@ permissions: id-token: write contents: read +# Allow one instance of this workflow per pull request, and cancel older runs when new changes are pushed +concurrency: + group: ci-codebuild-${{ github.ref }} + cancel-in-progress: true + jobs: e2e-tests: runs-on: ubuntu-latest @@ -20,9 +25,19 @@ jobs: role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} aws-region: us-west-2 - name: Run E2E Tests + id: e2e-tests uses: aws-actions/aws-codebuild-run-build@v1 with: project-name: gh-aws-sdk-kotlin-e2e-tests + - name: Cancel build + if: ${{ cancelled() }} + env: + BUILD_ID: ${{ steps.e2e-tests.outputs.aws-build-id }} + run: | + if [ -z "$BUILD_ID"]; then + echo "cancelling in-progress build: id=$BUILD_ID" + aws codebuild stop-build --id $BUILD_ID + fi service-check-batch: runs-on: ubuntu-latest @@ -35,5 +50,15 @@ jobs: role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} aws-region: us-west-2 - name: Run Service Check Batch + id: svc-check-batch run: | .github/scripts/run-codebuild-batch-job.sh gh-aws-sdk-kotlin-svc-check-batch ${{ github.event.pull_request.head.sha }} + - name: Cancel build + if: ${{ cancelled() }} + env: + BUILD_ID: ${{ steps.svc-check-batch.outputs.aws-build-id }} + run: | + if [ -z "$BUILD_ID"]; then + echo "cancelling in-progress batch build: id=$BUILD_ID" + aws codebuild stop-build --id $BUILD_ID + fi diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 88fc412f126..85d84a80b04 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -9,6 +9,11 @@ on: - 'feat-*' workflow_dispatch: +# Allow one instance of this workflow per pull request, and cancel older runs when new changes are pushed +concurrency: + group: ci-pr-${{ github.ref }} + cancel-in-progress: true + env: BUILDER_VERSION: v0.8.22 BUILDER_SOURCE: releases diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml index ffc95a3131e..16b5bf13043 100644 --- a/.github/workflows/release-check.yml +++ b/.github/workflows/release-check.yml @@ -5,6 +5,11 @@ on: types: [ opened, synchronize, reopened ] branches: [ main ] +# Allow one instance of this workflow per pull request, and cancel older runs when new changes are pushed +concurrency: + group: ci-release-check-${{ github.ref }} + cancel-in-progress: true + jobs: release-check: runs-on: ubuntu-latest From a7fad65193a1a79a2f01bd034b6173ac8708f1e2 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Mon, 9 Oct 2023 14:06:21 -0400 Subject: [PATCH 04/23] tickle ci From 6dd7452ee44c84bd1e6f44ba7a0eddbf4176edcb Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Mon, 9 Oct 2023 14:08:45 -0400 Subject: [PATCH 05/23] fixes --- .github/workflows/codebuild-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codebuild-ci.yml b/.github/workflows/codebuild-ci.yml index 9352c088989..d3bcdd1b74b 100644 --- a/.github/workflows/codebuild-ci.yml +++ b/.github/workflows/codebuild-ci.yml @@ -34,7 +34,7 @@ jobs: env: BUILD_ID: ${{ steps.e2e-tests.outputs.aws-build-id }} run: | - if [ -z "$BUILD_ID"]; then + if [ ! -z "$BUILD_ID"]; then echo "cancelling in-progress build: id=$BUILD_ID" aws codebuild stop-build --id $BUILD_ID fi @@ -58,7 +58,7 @@ jobs: env: BUILD_ID: ${{ steps.svc-check-batch.outputs.aws-build-id }} run: | - if [ -z "$BUILD_ID"]; then + if [ ! -z "$BUILD_ID" ]; then echo "cancelling in-progress batch build: id=$BUILD_ID" aws codebuild stop-build --id $BUILD_ID fi From 483066dacbf628cce5cb47b9ad28ab33c67dbffd Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Mon, 9 Oct 2023 14:09:41 -0400 Subject: [PATCH 06/23] tickle ci From 67e022bf060e635a60b12d9aedee23a2dc30a162 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Mon, 9 Oct 2023 17:14:14 -0400 Subject: [PATCH 07/23] use jdk17 for codegen --- codegen/smithy-aws-kotlin-codegen/build.gradle.kts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/codegen/smithy-aws-kotlin-codegen/build.gradle.kts b/codegen/smithy-aws-kotlin-codegen/build.gradle.kts index 36186044fd7..59893ae04cd 100644 --- a/codegen/smithy-aws-kotlin-codegen/build.gradle.kts +++ b/codegen/smithy-aws-kotlin-codegen/build.gradle.kts @@ -16,6 +16,13 @@ version = sdkVersion val kotlinJVMTargetVersion: String by project +// codegen uses +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(17)) + } +} + dependencies { implementation(libs.kotlin.stdlib.jdk8) From 93188251a783fd59f4d06c99e752b8f31f1ed493 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 09:45:35 -0400 Subject: [PATCH 08/23] update release checks --- .github/workflows/release-check.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml index 16b5bf13043..c522c660eab 100644 --- a/.github/workflows/release-check.yml +++ b/.github/workflows/release-check.yml @@ -15,14 +15,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/cache@v3 + - name: Configure JDK + uses: actions/setup-java@v3 with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-gradle- + distribution: 'corretto' + java-version: 17 + cache: 'gradle' - name: Check for snapshot versions run: | # We aren't releasable if we (1) directly depend on a snapshot version of a dependency OR (2) can't build the project without unreleased changes From 942530368c93e4ee49474441725655ce52f860d5 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 09:54:07 -0400 Subject: [PATCH 09/23] wip composite action --- .github/workflows/continuous-integration.yml | 131 +++++++++++------- build.gradle.kts | 17 ++- .../build.gradle.kts | 12 +- 3 files changed, 95 insertions(+), 65 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 85d84a80b04..7745d246bea 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -28,61 +28,86 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v4 - - uses: actions/cache@v3 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Build and Test ${{ env.PACKAGE_NAME }} - run: | - python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" - chmod a+x builder.pyz - echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties - ./builder.pyz build -p ${{ env.PACKAGE_NAME }} - - macos-compat: - runs-on: macos-latest - steps: - - name: Checkout sources + - name: Checkout tools uses: actions/checkout@v4 - - uses: actions/cache@v3 with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-gradle- - - name: Build and Test ${{ env.PACKAGE_NAME }} - run: | - python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" - chmod a+x builder.pyz - echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties - ./builder.pyz build -p ${{ env.PACKAGE_NAME }} - - windows-compat: - runs-on: windows-2019 - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + path: 'aws-kotlin-repo-tools' + repository: 'awslabs/aws-kotlin-repo-tools' + ref: 'gh-action' + sparse-checkout: | + .github + - name: Checkout smithy-kotlin + uses: ./aws-kotlin-repo-tools/.github/actions/checkout-head with: - distribution: 'temurin' - java-version: '11' - cache: 'gradle' - - name: Modify Gradle Daemon JVM Args - # windows job runs out of memory with the defaults normally used - shell: bash - run: | - systeminfo - sed -i 's/org\.gradle\.jvmargs=.*$/org.gradle.jvmargs=-Xmx2g/' gradle.properties - echo "org.gradle.parallel=false" >> gradle.properties - cat gradle.properties + path: 'smithy-kotlin' + repository: 'awslabs/smithy-kotlin' - name: Build and Test ${{ env.PACKAGE_NAME }} run: | - python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" - java -version - python3 builder.pyz build -p ${{ env.PACKAGE_NAME }} + pwd + ls -lsa + cd smithy-kotlin + git branch --show-current + +# linux-compat: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 +# - uses: actions/cache@v3 +# with: +# path: | +# ~/.gradle/caches +# ~/.gradle/wrapper +# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} +# restore-keys: | +# ${{ runner.os }}-gradle- +# - name: Build and Test ${{ env.PACKAGE_NAME }} +# run: | +# python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" +# chmod a+x builder.pyz +# echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties +# ./builder.pyz build -p ${{ env.PACKAGE_NAME }} +# +# macos-compat: +# runs-on: macos-latest +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 +# - uses: actions/cache@v3 +# with: +# path: | +# ~/.gradle/caches +# ~/.gradle/wrapper +# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} +# restore-keys: | +# ${{ runner.os }}-gradle- +# - name: Build and Test ${{ env.PACKAGE_NAME }} +# run: | +# python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" +# chmod a+x builder.pyz +# echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties +# ./builder.pyz build -p ${{ env.PACKAGE_NAME }} +# +# windows-compat: +# runs-on: windows-2019 +# steps: +# - name: Checkout sources +# uses: actions/checkout@v4 +# - uses: actions/setup-java@v3 +# with: +# distribution: 'temurin' +# java-version: '11' +# cache: 'gradle' +# - name: Modify Gradle Daemon JVM Args +# # windows job runs out of memory with the defaults normally used +# shell: bash +# run: | +# systeminfo +# sed -i 's/org\.gradle\.jvmargs=.*$/org.gradle.jvmargs=-Xmx2g/' gradle.properties +# echo "org.gradle.parallel=false" >> gradle.properties +# cat gradle.properties +# - name: Build and Test ${{ env.PACKAGE_NAME }} +# run: | +# python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" +# java -version +# python3 builder.pyz build -p ${{ env.PACKAGE_NAME }} diff --git a/build.gradle.kts b/build.gradle.kts index 6ea2e149b83..dc8e3b376f3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,6 +28,8 @@ plugins { // configures (KMP) subprojects with our own KMP conventions and some default dependencies apply(plugin = "aws.sdk.kotlin.kmp") +val testJavaVersion = typedProp("test.java.version") + allprojects { tasks.withType().configureEach { val sdkVersion: String by project @@ -53,9 +55,7 @@ allprojects { ) pluginsMapConfiguration.set(pluginConfigMap) } -} -subprojects { tasks.withType().configureEach { // each module can include their own top-level module documentation // see https://kotlinlang.org/docs/kotlin-doc.html#module-and-package-documentation @@ -83,14 +83,21 @@ subprojects { } } } -} -if (project.typedProp("kotlinWarningsAsErrors") == true) { - subprojects { + if (rootProject.typedProp("kotlinWarningsAsErrors") == true) { tasks.withType { kotlinOptions.allWarningsAsErrors = true } } + + if (testJavaVersion != null) { + tasks.withType { + val toolchains = project.extensions.getByType() + javaLauncher.set(toolchains.launcherFor { + languageVersion.set(JavaLanguageVersion.of(testJavaVersion)) + }) + } + } } project.afterEvaluate { diff --git a/codegen/smithy-aws-kotlin-codegen/build.gradle.kts b/codegen/smithy-aws-kotlin-codegen/build.gradle.kts index 59893ae04cd..8b1349e037a 100644 --- a/codegen/smithy-aws-kotlin-codegen/build.gradle.kts +++ b/codegen/smithy-aws-kotlin-codegen/build.gradle.kts @@ -16,13 +16,6 @@ version = sdkVersion val kotlinJVMTargetVersion: String by project -// codegen uses -java { - toolchain { - languageVersion.set(JavaLanguageVersion.of(17)) - } -} - dependencies { implementation(libs.kotlin.stdlib.jdk8) @@ -68,6 +61,11 @@ tasks.compileTestKotlin { kotlinOptions.jvmTarget = kotlinJVMTargetVersion } +tasks.withType { + sourceCompatibility = JavaVersion.valueOf(kotlinJVMTargetVersion).toString() + targetCompatibility = JavaVersion.valueOf(kotlinJVMTargetVersion).toString() +} + // Reusable license copySpec val licenseSpec = copySpec { from("${project.rootDir}/LICENSE") From 2169ef573a95ddb894155bd9f9d8f62d112c8da1 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 10:34:00 -0400 Subject: [PATCH 10/23] separate out build setup into a reusable action --- .github/actions/setup-build/action.yml | 40 ++++++++++++++++++++ .github/workflows/continuous-integration.yml | 30 +++++++-------- 2 files changed, 53 insertions(+), 17 deletions(-) create mode 100644 .github/actions/setup-build/action.yml diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml new file mode 100644 index 00000000000..76e7fb8a3b7 --- /dev/null +++ b/.github/actions/setup-build/action.yml @@ -0,0 +1,40 @@ +name: Setup Build +description: > + Checkout repositories and build dependencies + +runs: + using: composite + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + path: 'aws-sdk-kotlin' + - name: Checkout tools + uses: actions/checkout@v4 + with: + path: 'aws-kotlin-repo-tools' + repository: 'awslabs/aws-kotlin-repo-tools' + ref: 'gh-action' + sparse-checkout: | + .github + - name: Checkout smithy-kotlin + uses: ./aws-kotlin-repo-tools/.github/actions/checkout-head + with: + # checkout smithy-kotlin as a sibling which will automatically make it an included build + path: 'smithy-kotlin' + repository: 'awslabs/smithy-kotlin' + - name: Configure JDK + uses: actions/setup-java@v3 + with: + distribution: 'corretto' + java-version: 17 + cache: 'gradle' + - name: Build smithy-kotlin + shell: bash + run: | + echo "REPO_TOOLS=$GITHUB_WORKSPACE/aws-kotlin-repo-tools" >> "$GITHUB_ENV" + echo "SMITHY_KOTLIN_DIR=$GITHUB_WORKSPACE/smithy-kotlin" >> "$GITHUB_ENV" + echo "SDK_DIR=$GITHUB_WORKSPACE/aws-sdk-kotlin" >> "$GITHUB_ENV" + pushd $SMITHY_KOTLIN_DIR + ./gradlew assemble publishToMavenLocal + popd diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 7745d246bea..fcaae000f09 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -26,27 +26,23 @@ jobs: linux-compat: runs-on: ubuntu-latest steps: - - name: Checkout sources - uses: actions/checkout@v4 - - name: Checkout tools - uses: actions/checkout@v4 + - name: Setup Build + uses: ./github/actions/setup-build with: - path: 'aws-kotlin-repo-tools' - repository: 'awslabs/aws-kotlin-repo-tools' - ref: 'gh-action' - sparse-checkout: | - .github - - name: Checkout smithy-kotlin - uses: ./aws-kotlin-repo-tools/.github/actions/checkout-head - with: - path: 'smithy-kotlin' - repository: 'awslabs/smithy-kotlin' - - name: Build and Test ${{ env.PACKAGE_NAME }} + path: 'aws-sdk-kotlin' + - name: Test run: | pwd ls -lsa - cd smithy-kotlin - git branch --show-current + pushd "$GITHUB_WORKSPACE/aws-sdk-kotlin" + ./gradlew publishToMavenLocal + ./gradlew apiCheck + ./gradlew test allTests", + systeminfo + ./gradlew --status + ./gradlew --stop + systeminfo + ./gradlew testAllProtocols # linux-compat: # runs-on: ubuntu-latest From 85d35f9509d64ce3399093e6342a50141453780e Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 10:36:23 -0400 Subject: [PATCH 11/23] try again --- .github/actions/setup-build/action.yml | 4 ---- .github/workflows/continuous-integration.yml | 6 +++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml index 76e7fb8a3b7..5f21963c43f 100644 --- a/.github/actions/setup-build/action.yml +++ b/.github/actions/setup-build/action.yml @@ -5,10 +5,6 @@ description: > runs: using: composite steps: - - name: Checkout sources - uses: actions/checkout@v4 - with: - path: 'aws-sdk-kotlin' - name: Checkout tools uses: actions/checkout@v4 with: diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index fcaae000f09..39fb3ee17b5 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -26,8 +26,12 @@ jobs: linux-compat: runs-on: ubuntu-latest steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + path: 'aws-sdk-kotlin' - name: Setup Build - uses: ./github/actions/setup-build + uses: ./aws-sdk-kotlin/.github/actions/setup-build with: path: 'aws-sdk-kotlin' - name: Test From 11d93a10c2e3662924314b151a4fb3077324a237 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 10:41:31 -0400 Subject: [PATCH 12/23] sigh --- .github/actions/setup-build/action.yml | 5 +---- .github/workflows/continuous-integration.yml | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml index 5f21963c43f..8265b5d4efa 100644 --- a/.github/actions/setup-build/action.yml +++ b/.github/actions/setup-build/action.yml @@ -28,9 +28,6 @@ runs: - name: Build smithy-kotlin shell: bash run: | - echo "REPO_TOOLS=$GITHUB_WORKSPACE/aws-kotlin-repo-tools" >> "$GITHUB_ENV" - echo "SMITHY_KOTLIN_DIR=$GITHUB_WORKSPACE/smithy-kotlin" >> "$GITHUB_ENV" - echo "SDK_DIR=$GITHUB_WORKSPACE/aws-sdk-kotlin" >> "$GITHUB_ENV" - pushd $SMITHY_KOTLIN_DIR + pushd "$GITHUB_WORKSPACE/smithy-kotlin ./gradlew assemble publishToMavenLocal popd diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 39fb3ee17b5..06b0debc221 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -32,8 +32,6 @@ jobs: path: 'aws-sdk-kotlin' - name: Setup Build uses: ./aws-sdk-kotlin/.github/actions/setup-build - with: - path: 'aws-sdk-kotlin' - name: Test run: | pwd From a4f03f9564ceebf830df5f64d081a616a2c6a6f5 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 10:42:51 -0400 Subject: [PATCH 13/23] missing parens --- .github/actions/setup-build/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml index 8265b5d4efa..7cdca090041 100644 --- a/.github/actions/setup-build/action.yml +++ b/.github/actions/setup-build/action.yml @@ -28,6 +28,6 @@ runs: - name: Build smithy-kotlin shell: bash run: | - pushd "$GITHUB_WORKSPACE/smithy-kotlin + pushd "$GITHUB_WORKSPACE/smithy-kotlin" ./gradlew assemble publishToMavenLocal popd From c3bb626009b2146026c9257e9d9a33a2881127e8 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 11:07:21 -0400 Subject: [PATCH 14/23] fanout --- .github/actions/setup-build/action.yml | 3 +- .github/workflows/continuous-integration.yml | 49 +++++++++++++------ .../build.gradle.kts | 4 +- 3 files changed, 38 insertions(+), 18 deletions(-) diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml index 7cdca090041..d07af4d2886 100644 --- a/.github/actions/setup-build/action.yml +++ b/.github/actions/setup-build/action.yml @@ -29,5 +29,6 @@ runs: shell: bash run: | pushd "$GITHUB_WORKSPACE/smithy-kotlin" - ./gradlew assemble publishToMavenLocal + ./gradlew --parallel assemble + ./gradlew publishToMavenLocal popd diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 06b0debc221..01e23cb4442 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -4,9 +4,6 @@ on: push: branches: [ main ] pull_request: - branches: - - main - - 'feat-*' workflow_dispatch: # Allow one instance of this workflow per pull request, and cancel older runs when new changes are pushed @@ -15,16 +12,20 @@ concurrency: cancel-in-progress: true env: - BUILDER_VERSION: v0.8.22 - BUILDER_SOURCE: releases - # host owned by CRT team to host aws-crt-builder releases. Contact their on-call with any issues - BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net - PACKAGE_NAME: aws-sdk-kotlin RUN: ${{ github.run_id }}-${{ github.run_number }} + GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dkotlin.incremental=false" jobs: - linux-compat: + jvm: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + java-version: + - 8 + - 11 + - 17 + - 19 steps: - name: Checkout sources uses: actions/checkout@v4 @@ -33,17 +34,35 @@ jobs: - name: Setup Build uses: ./aws-sdk-kotlin/.github/actions/setup-build - name: Test + working-directory: ./aws-sdk-kotlin + shell: bash run: | pwd ls -lsa - pushd "$GITHUB_WORKSPACE/aws-sdk-kotlin" + ./gradlew -Djava.test.version=${{ matrix.java-version }} jvmTest --stacktrace", + + all-platforms: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-2019 ] + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + path: 'aws-sdk-kotlin' + - name: Setup Build + uses: ./aws-sdk-kotlin/.github/actions/setup-build + - name: Test + working-directory: ./aws-sdk-kotlin + shell: bash + run: | + pwd + systeminfo ./gradlew publishToMavenLocal ./gradlew apiCheck - ./gradlew test allTests", - systeminfo - ./gradlew --status - ./gradlew --stop - systeminfo + ./gradlew test allTests ./gradlew testAllProtocols # linux-compat: diff --git a/codegen/smithy-aws-kotlin-codegen/build.gradle.kts b/codegen/smithy-aws-kotlin-codegen/build.gradle.kts index 8b1349e037a..f6a5ddf3aa0 100644 --- a/codegen/smithy-aws-kotlin-codegen/build.gradle.kts +++ b/codegen/smithy-aws-kotlin-codegen/build.gradle.kts @@ -62,8 +62,8 @@ tasks.compileTestKotlin { } tasks.withType { - sourceCompatibility = JavaVersion.valueOf(kotlinJVMTargetVersion).toString() - targetCompatibility = JavaVersion.valueOf(kotlinJVMTargetVersion).toString() + sourceCompatibility = JavaVersion.toVersion(kotlinJVMTargetVersion).toString() + targetCompatibility = JavaVersion.toVersion(kotlinJVMTargetVersion).toString() } // Reusable license copySpec From 7b72ed250f88c9f96012d202c6f858893f03e5a7 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 11:47:37 -0400 Subject: [PATCH 15/23] round 2 --- .github/workflows/continuous-integration.yml | 72 +------------------- 1 file changed, 3 insertions(+), 69 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 01e23cb4442..26e6d5244c3 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,8 +1,6 @@ name: CI on: - push: - branches: [ main ] pull_request: workflow_dispatch: @@ -39,7 +37,7 @@ jobs: run: | pwd ls -lsa - ./gradlew -Djava.test.version=${{ matrix.java-version }} jvmTest --stacktrace", + ./gradlew -Djava.test.version=${{ matrix.java-version }} jvmTest --stacktrace all-platforms: runs-on: ${{ matrix.os }} @@ -59,72 +57,8 @@ jobs: shell: bash run: | pwd - systeminfo + # protocol tests require everything is published ./gradlew publishToMavenLocal ./gradlew apiCheck ./gradlew test allTests - ./gradlew testAllProtocols - -# linux-compat: -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 -# - uses: actions/cache@v3 -# with: -# path: | -# ~/.gradle/caches -# ~/.gradle/wrapper -# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} -# restore-keys: | -# ${{ runner.os }}-gradle- -# - name: Build and Test ${{ env.PACKAGE_NAME }} -# run: | -# python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" -# chmod a+x builder.pyz -# echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties -# ./builder.pyz build -p ${{ env.PACKAGE_NAME }} -# -# macos-compat: -# runs-on: macos-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 -# - uses: actions/cache@v3 -# with: -# path: | -# ~/.gradle/caches -# ~/.gradle/wrapper -# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} -# restore-keys: | -# ${{ runner.os }}-gradle- -# - name: Build and Test ${{ env.PACKAGE_NAME }} -# run: | -# python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" -# chmod a+x builder.pyz -# echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties -# ./builder.pyz build -p ${{ env.PACKAGE_NAME }} -# -# windows-compat: -# runs-on: windows-2019 -# steps: -# - name: Checkout sources -# uses: actions/checkout@v4 -# - uses: actions/setup-java@v3 -# with: -# distribution: 'temurin' -# java-version: '11' -# cache: 'gradle' -# - name: Modify Gradle Daemon JVM Args -# # windows job runs out of memory with the defaults normally used -# shell: bash -# run: | -# systeminfo -# sed -i 's/org\.gradle\.jvmargs=.*$/org.gradle.jvmargs=-Xmx2g/' gradle.properties -# echo "org.gradle.parallel=false" >> gradle.properties -# cat gradle.properties -# - name: Build and Test ${{ env.PACKAGE_NAME }} -# run: | -# python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" -# java -version -# python3 builder.pyz build -p ${{ env.PACKAGE_NAME }} + ./gradlew testAllProtocols \ No newline at end of file From 940dbe18186dde80da0e7402369b3aba12c9c5a7 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 12:03:34 -0400 Subject: [PATCH 16/23] round 3 --- .github/actions/setup-build/action.yml | 7 ------- .github/workflows/codegen-preview.yml | 1 - .github/workflows/continuous-integration.yml | 11 +++++++++-- codegen/smithy-aws-kotlin-codegen/build.gradle.kts | 12 +++++------- gradle.properties | 3 --- 5 files changed, 14 insertions(+), 20 deletions(-) diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml index d07af4d2886..677a171c79f 100644 --- a/.github/actions/setup-build/action.yml +++ b/.github/actions/setup-build/action.yml @@ -25,10 +25,3 @@ runs: distribution: 'corretto' java-version: 17 cache: 'gradle' - - name: Build smithy-kotlin - shell: bash - run: | - pushd "$GITHUB_WORKSPACE/smithy-kotlin" - ./gradlew --parallel assemble - ./gradlew publishToMavenLocal - popd diff --git a/.github/workflows/codegen-preview.yml b/.github/workflows/codegen-preview.yml index 17329dac0a5..97bd89f4773 100644 --- a/.github/workflows/codegen-preview.yml +++ b/.github/workflows/codegen-preview.yml @@ -49,7 +49,6 @@ jobs: - uses: actions/checkout@v4 with: repository: 'awslabs/aws-kotlin-repo-tools' - ref: 'ci-utils' path: 'aws-kotlin-repo-tools' - uses: actions/checkout@v4 with: diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 26e6d5244c3..fc6629f5bf8 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -23,7 +23,7 @@ jobs: - 8 - 11 - 17 - - 19 + - 21 steps: - name: Checkout sources uses: actions/checkout@v4 @@ -52,12 +52,19 @@ jobs: path: 'aws-sdk-kotlin' - name: Setup Build uses: ./aws-sdk-kotlin/.github/actions/setup-build + - name: Build smithy-kotlin + working-directory: ./smithy-kotlin + shell: bash + run: | + # protocol tests require everything is published + pwd + ./gradlew --parallel assemble + ./gradlew publishToMavenLocal - name: Test working-directory: ./aws-sdk-kotlin shell: bash run: | pwd - # protocol tests require everything is published ./gradlew publishToMavenLocal ./gradlew apiCheck ./gradlew test allTests diff --git a/codegen/smithy-aws-kotlin-codegen/build.gradle.kts b/codegen/smithy-aws-kotlin-codegen/build.gradle.kts index f6a5ddf3aa0..def930265a9 100644 --- a/codegen/smithy-aws-kotlin-codegen/build.gradle.kts +++ b/codegen/smithy-aws-kotlin-codegen/build.gradle.kts @@ -14,8 +14,6 @@ description = "Codegen support for AWS protocols" group = "software.amazon.smithy.kotlin" version = sdkVersion -val kotlinJVMTargetVersion: String by project - dependencies { implementation(libs.kotlin.stdlib.jdk8) @@ -53,17 +51,17 @@ val generateSdkRuntimeVersion by tasks.registering { } tasks.compileKotlin { - kotlinOptions.jvmTarget = kotlinJVMTargetVersion + kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString() dependsOn(generateSdkRuntimeVersion) } tasks.compileTestKotlin { - kotlinOptions.jvmTarget = kotlinJVMTargetVersion + kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString() } tasks.withType { - sourceCompatibility = JavaVersion.toVersion(kotlinJVMTargetVersion).toString() - targetCompatibility = JavaVersion.toVersion(kotlinJVMTargetVersion).toString() + sourceCompatibility = JavaVersion.VERSION_1_8.toString() + targetCompatibility = JavaVersion.VERSION_1_8.toString() } // Reusable license copySpec @@ -107,7 +105,7 @@ tasks["test"].finalizedBy(tasks["jacocoTestReport"]) val sourcesJar by tasks.creating(Jar::class) { group = "publishing" description = "Assembles Kotlin sources jar" - classifier = "sources" + archiveClassifier.set("sources") from(sourceSets.getByName("main").allSource) } diff --git a/gradle.properties b/gradle.properties index 43ec175b931..c565a8d4636 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,8 +11,5 @@ sdkVersion=0.32.5-SNAPSHOT # kotlin kotlinVersion=1.8.22 -# kotlin JVM -kotlinJVMTargetVersion=1.8 - # dokka config (values specified at build-time as needed) smithyKotlinDocBaseUrl=https://sdk.amazonaws.com/kotlin/api/smithy-kotlin/api/$smithyKotlinVersion/ \ No newline at end of file From 258fd5ab0ffa6a592d93f87ae4113f7b5e549bcf Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 12:11:29 -0400 Subject: [PATCH 17/23] try harder --- .github/workflows/continuous-integration.yml | 2 ++ codegen/smithy-aws-kotlin-codegen/build.gradle.kts | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index fc6629f5bf8..d9805745fbf 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -19,6 +19,8 @@ jobs: strategy: fail-fast: false matrix: + # we build with a specific JDK version but source/target compatibility should ensure the jar is usable by + # the target versions we want to support java-version: - 8 - 11 diff --git a/codegen/smithy-aws-kotlin-codegen/build.gradle.kts b/codegen/smithy-aws-kotlin-codegen/build.gradle.kts index def930265a9..72d61caa8c6 100644 --- a/codegen/smithy-aws-kotlin-codegen/build.gradle.kts +++ b/codegen/smithy-aws-kotlin-codegen/build.gradle.kts @@ -50,18 +50,20 @@ val generateSdkRuntimeVersion by tasks.registering { } } +val jvmTargetVersion = JavaVersion.VERSION_17.toString() + tasks.compileKotlin { - kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString() + kotlinOptions.jvmTarget = jvmTargetVersion dependsOn(generateSdkRuntimeVersion) } tasks.compileTestKotlin { - kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString() + kotlinOptions.jvmTarget = jvmTargetVersion } tasks.withType { - sourceCompatibility = JavaVersion.VERSION_1_8.toString() - targetCompatibility = JavaVersion.VERSION_1_8.toString() + sourceCompatibility = jvmTargetVersion + targetCompatibility = jvmTargetVersion } // Reusable license copySpec From a6582fa7dc0ec3ed38da0013ba47c1b605b49f42 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 12:41:39 -0400 Subject: [PATCH 18/23] fix props --- .github/workflows/continuous-integration.yml | 2 +- build.gradle.kts | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index d9805745fbf..ed91b5187ca 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -39,7 +39,7 @@ jobs: run: | pwd ls -lsa - ./gradlew -Djava.test.version=${{ matrix.java-version }} jvmTest --stacktrace + ./gradlew -Ptest.java.version=${{ matrix.java-version }} jvmTest --stacktrace all-platforms: runs-on: ${{ matrix.os }} diff --git a/build.gradle.kts b/build.gradle.kts index dc8e3b376f3..65766de66a9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,7 +28,11 @@ plugins { // configures (KMP) subprojects with our own KMP conventions and some default dependencies apply(plugin = "aws.sdk.kotlin.kmp") -val testJavaVersion = typedProp("test.java.version") +val testJavaVersion = typedProp("test.java.version")?.let { + JavaLanguageVersion.of(it) +}?.also { + println("configuring tests to run with jdk $it") +} allprojects { tasks.withType().configureEach { @@ -93,9 +97,11 @@ allprojects { if (testJavaVersion != null) { tasks.withType { val toolchains = project.extensions.getByType() - javaLauncher.set(toolchains.launcherFor { - languageVersion.set(JavaLanguageVersion.of(testJavaVersion)) - }) + javaLauncher.set( + toolchains.launcherFor { + languageVersion.set(testJavaVersion) + }, + ) } } } From 224299eb3674ecfdaa19870b54dae937bd943baa Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 12:52:21 -0400 Subject: [PATCH 19/23] explicitly set jvmTarget compat rather than rely on default --- aws-runtime/build.gradle.kts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws-runtime/build.gradle.kts b/aws-runtime/build.gradle.kts index 0cb52a65341..3a1195ec12a 100644 --- a/aws-runtime/build.gradle.kts +++ b/aws-runtime/build.gradle.kts @@ -62,6 +62,12 @@ subprojects { dependencies { dokkaPlugin(project(":dokka-aws")) } + + tasks.withType { + kotlinOptions { + jvmTarget = "1.8" + } + } } apiValidation { From 365e87c610332e628948773b36c8caaaff7f33b7 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 12:56:59 -0400 Subject: [PATCH 20/23] bump jvm version for codegen diff preview --- .github/workflows/codegen-preview.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/codegen-preview.yml b/.github/workflows/codegen-preview.yml index 97bd89f4773..d142925cee6 100644 --- a/.github/workflows/codegen-preview.yml +++ b/.github/workflows/codegen-preview.yml @@ -19,7 +19,7 @@ concurrency: cancel-in-progress: true env: - JAVA_VERSION: 11 + JAVA_VERSION: 17 RUN: ${{ github.run_id }}-${{ github.run_number }} DIFF2HTML_VERSION: 5.2.5 # Below is the set of services that are generated for codegen preview @@ -55,20 +55,11 @@ jobs: repository: 'awslabs/smithy-kotlin' fetch-depth: 0 path: 'smithy-kotlin' - - uses: actions/cache@v2 - name: Gradle Cache - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-gradle- - name: Set up JDK - uses: actions/setup-java@v1 + uses: actions/setup-java@v3 with: java-version: ${{ env.JAVA_VERSION }} - + cache: 'gradle' - name: Install deps and setup environment run: | npm install -g diff2html-cli@${{ env.DIFF2HTML_VERSION }} From 2d1c4699172df664f7d7793bb9a9750ee900545f Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 13:07:09 -0400 Subject: [PATCH 21/23] fix workflow --- .github/workflows/codegen-preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codegen-preview.yml b/.github/workflows/codegen-preview.yml index d142925cee6..e2fa99d3a30 100644 --- a/.github/workflows/codegen-preview.yml +++ b/.github/workflows/codegen-preview.yml @@ -59,6 +59,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: ${{ env.JAVA_VERSION }} + distribution: 'corretto' cache: 'gradle' - name: Install deps and setup environment run: | From 98724712f859e12946387b58680d70d6c8f29ed2 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Tue, 10 Oct 2023 15:29:18 -0400 Subject: [PATCH 22/23] capture test outputs --- .github/workflows/continuous-integration.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index ed91b5187ca..f94757bfc16 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -70,4 +70,10 @@ jobs: ./gradlew publishToMavenLocal ./gradlew apiCheck ./gradlew test allTests - ./gradlew testAllProtocols \ No newline at end of file + ./gradlew testAllProtocols + - name: Save Test Reports + if: failure() + uses: actions/upload-artifact@v3 + with: + name: test-reports + path: '**/build/reports' From 71307f37d4f291c7663a994a8afa82b153a7bff9 Mon Sep 17 00:00:00 2001 From: Aaron J Todd Date: Wed, 11 Oct 2023 09:55:55 -0400 Subject: [PATCH 23/23] use tagged repo tools and update to windows-latest image to match smithy-kotlin --- .github/actions/setup-build/action.yml | 2 +- .github/workflows/continuous-integration.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-build/action.yml b/.github/actions/setup-build/action.yml index 677a171c79f..8dca54fbde4 100644 --- a/.github/actions/setup-build/action.yml +++ b/.github/actions/setup-build/action.yml @@ -10,7 +10,7 @@ runs: with: path: 'aws-kotlin-repo-tools' repository: 'awslabs/aws-kotlin-repo-tools' - ref: 'gh-action' + ref: '0.2.3' sparse-checkout: | .github - name: Checkout smithy-kotlin diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index f94757bfc16..305348a26d4 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -46,7 +46,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macos-latest, windows-2019 ] + os: [ ubuntu-latest, macos-latest, windows-latest ] steps: - name: Checkout sources uses: actions/checkout@v4