Skip to content

Codegen, Build, and Test #25

Codegen, Build, and Test

Codegen, Build, and Test #25

# 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
AWS_SWIFT_SDK_USE_LOCAL_DEPS: 1
jobs:
codegen-build-test:
runs-on: macos-13
env:
DEVELOPER_DIR: /Applications/Xcode_14.3.app/Contents/Developer
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Restore Cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up Java (Corretto 17)
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- name: Tools Versions
run: |
which swiftc
swiftc --version
echo
which xcodebuild
xcodebuild -version
echo
which java
java --version
- 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
./builder.pyz build -p ${{ env.PACKAGE_NAME }}
./gradlew -p codegen/sdk-codegen build
./gradlew -p codegen/sdk-codegen stageSdks
./gradlew --stop
./scripts/mergeModels.sh Sources/Services
cd AWSSDKSwiftCLI
swift run AWSSDKSwiftCLI generate-package-manifest ../
cd ..
cat Package.swift
swift build --build-tests
swift test --skip-build