From dd3b392aab7afb0a956f70771a2de90314608c91 Mon Sep 17 00:00:00 2001 From: Ed Paulosky Date: Wed, 4 Jan 2023 15:48:30 -0500 Subject: [PATCH 1/3] Adds new workflow for building the full sdk --- .github/workflows/codegen-build-test.yml | 49 ++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/codegen-build-test.yml diff --git a/.github/workflows/codegen-build-test.yml b/.github/workflows/codegen-build-test.yml new file mode 100644 index 00000000000..9b6236f56e6 --- /dev/null +++ b/.github/workflows/codegen-build-test.yml @@ -0,0 +1,49 @@ +# This script is for building the full SDK +# It will regenerate all models, build the full SDK with the new models, and run tests. +name: Codegen, Build, and Test + +on: + workflow_dispatch: + +env: + BUILDER_VERSION: v0.8.19 + 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-swift + LINUX_BASE_IMAGE: ubuntu-16-x64 + RUN: ${{ github.run_id }}-${{ github.run_number }} + AWS_SDK_SWIFT_CI_DIR: /Users/runner/work/aws-sdk-swift/aws-sdk-swift + AWS_CRT_SWIFT_CI_DIR: /Users/runner/work/aws-sdk-swift/aws-sdk-swift/target/build/deps/aws-crt-swift + SMITHY_SWIFT_CI_DIR: /Users/runner/work/aws-sdk-swift/aws-sdk-swift/target/build/deps/smithy-swift + +jobs: + codegen-build-test: + runs-on: macos-11 + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + - uses: actions/setup-java@v1 + with: + java-version: '11' + - 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 + AWS_CRT_SWIFT_CI_DIR="${{ env.AWS_CRT_SWIFT_CI_DIR }}" AWS_SDK_SWIFT_CI_DIR="${{ env.AWS_SDK_SWIFT_CI_DIR }}" SMITHY_SWIFT_CI_DIR="${{ env.SMITHY_SWIFT_CI_DIR }}" ./builder.pyz build -p ${{ env.PACKAGE_NAME }} + ./gradlew -p codegen/sdk-codegen build + ./gradlew -p codegen/sdk-codegen stageSdks + ./scripts/mergeModels.sh release + ./scripts/generatePackageSwift.swift > Package.swift + cat Package.swift + ./gradlew --stop + swift build --build-tests + swift test --skip-build \ No newline at end of file From 8b64ff30f8e4cc0c53f0e1dfee62e343e9c521ee Mon Sep 17 00:00:00 2001 From: Ed Paulosky Date: Wed, 4 Jan 2023 19:40:51 -0500 Subject: [PATCH 2/3] Adds command to removes release folder when generating models --- .github/workflows/codegen-build-test.yml | 1 + .github/workflows/release.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/codegen-build-test.yml b/.github/workflows/codegen-build-test.yml index 9b6236f56e6..53ee23facfa 100644 --- a/.github/workflows/codegen-build-test.yml +++ b/.github/workflows/codegen-build-test.yml @@ -40,6 +40,7 @@ jobs: chmod a+x builder.pyz AWS_CRT_SWIFT_CI_DIR="${{ env.AWS_CRT_SWIFT_CI_DIR }}" AWS_SDK_SWIFT_CI_DIR="${{ env.AWS_SDK_SWIFT_CI_DIR }}" SMITHY_SWIFT_CI_DIR="${{ env.SMITHY_SWIFT_CI_DIR }}" ./builder.pyz build -p ${{ env.PACKAGE_NAME }} ./gradlew -p codegen/sdk-codegen build + rm-rf release/ ./gradlew -p codegen/sdk-codegen stageSdks ./scripts/mergeModels.sh release ./scripts/generatePackageSwift.swift > Package.swift diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c73b12db92..eba5ee2d86b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,6 +47,7 @@ jobs: chmod a+x builder.pyz AWS_CRT_SWIFT_CI_DIR="${{ env.AWS_CRT_SWIFT_CI_DIR }}" AWS_SDK_SWIFT_CI_DIR="${{ env.AWS_SDK_SWIFT_CI_DIR }}" SMITHY_SWIFT_CI_DIR="${{ env.SMITHY_SWIFT_CI_DIR }}" ./builder.pyz build -p ${{ env.PACKAGE_NAME }} ./gradlew -p codegen/sdk-codegen build + rm-rf release/ ./gradlew -p codegen/sdk-codegen stageSdks ./scripts/mergeModels.sh release AWS_SDK_RELEASE_IN_PROGRESS=1 ./scripts/generatePackageSwift.swift > Package.swift From c12fce62a058693107cb2b6c12229e725a9cd278 Mon Sep 17 00:00:00 2001 From: Ed Paulosky Date: Thu, 5 Jan 2023 14:40:56 -0500 Subject: [PATCH 3/3] Fixes typo --- .github/workflows/codegen-build-test.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codegen-build-test.yml b/.github/workflows/codegen-build-test.yml index 53ee23facfa..463af4c08b9 100644 --- a/.github/workflows/codegen-build-test.yml +++ b/.github/workflows/codegen-build-test.yml @@ -40,7 +40,7 @@ jobs: chmod a+x builder.pyz AWS_CRT_SWIFT_CI_DIR="${{ env.AWS_CRT_SWIFT_CI_DIR }}" AWS_SDK_SWIFT_CI_DIR="${{ env.AWS_SDK_SWIFT_CI_DIR }}" SMITHY_SWIFT_CI_DIR="${{ env.SMITHY_SWIFT_CI_DIR }}" ./builder.pyz build -p ${{ env.PACKAGE_NAME }} ./gradlew -p codegen/sdk-codegen build - rm-rf release/ + rm -rf release/ ./gradlew -p codegen/sdk-codegen stageSdks ./scripts/mergeModels.sh release ./scripts/generatePackageSwift.swift > Package.swift diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eba5ee2d86b..8abc0a6795e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ jobs: chmod a+x builder.pyz AWS_CRT_SWIFT_CI_DIR="${{ env.AWS_CRT_SWIFT_CI_DIR }}" AWS_SDK_SWIFT_CI_DIR="${{ env.AWS_SDK_SWIFT_CI_DIR }}" SMITHY_SWIFT_CI_DIR="${{ env.SMITHY_SWIFT_CI_DIR }}" ./builder.pyz build -p ${{ env.PACKAGE_NAME }} ./gradlew -p codegen/sdk-codegen build - rm-rf release/ + rm -rf release/ ./gradlew -p codegen/sdk-codegen stageSdks ./scripts/mergeModels.sh release AWS_SDK_RELEASE_IN_PROGRESS=1 ./scripts/generatePackageSwift.swift > Package.swift