Model Integration #142
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Model Integration | |
# The purpose of this workflow is to detect breaking model changes within a | |
# day of when they are published. | |
# | |
# Pulls latest model changes from aws/aws-models | |
# Code-generates them | |
# Builds and tests SDK | |
# | |
# Runs nightly at 0700 UTC, or on manual dispatch. | |
# Uses main branch for aws-sdk-swift & smithy-swift, | |
# or selected branch if manually triggered. | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 7 * * *' | |
jobs: | |
model-integration: | |
runs-on: ubuntu-latest | |
container: swift:5.9-jammy | |
env: | |
AWS_SWIFT_SDK_USE_LOCAL_DEPS: 1 | |
steps: | |
- name: Checkout aws-sdk-swift | |
uses: actions/checkout@v3 | |
- name: Select smithy-swift branch | |
run: | | |
ORIGINAL_REPO_HEAD_REF="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME:-main}}" \ | |
DEPENDENCY_REPO_URL="https://github.com/smithy-lang/smithy-swift.git" \ | |
./scripts/ci_steps/select_dependency_branch.sh | |
- name: Checkout smithy-swift | |
uses: actions/checkout@v3 | |
with: | |
repository: smithy-lang/smithy-swift | |
ref: ${{ env.DEPENDENCY_REPO_SHA }} | |
path: smithy-swift | |
- name: Move smithy-swift into place | |
run: mv smithy-swift .. | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: corretto | |
java-version: 17 | |
- name: Install OpenSSL | |
run: apt-get -q update && apt-get -q install -y libssl-dev | |
- name: Tools Versions | |
run: ./scripts/ci_steps/log_tool_versions.sh | |
- name: Update models from aws/aws-models repo | |
env: | |
UPDATE_MODELS_GIT_URL: https://${{ secrets.GH_PAT_AWS_MODELS }}@github.com/aws/aws-models.git | |
run: | | |
cd codegen/sdk-codegen/scripts | |
./updatemodels.sh | |
cd ../../.. | |
- name: Delete previous generated code | |
run: | | |
rm -rf Sources/Services/* | |
rm -rf Tests/Services/* | |
- name: Generate Models | |
run: | | |
./gradlew -p codegen/sdk-codegen build | |
./gradlew -p codegen/sdk-codegen stageSdks | |
./gradlew --stop | |
./scripts/mergeModels.sh Sources/Services | |
- name: Regenerate Package.swift | |
run: | | |
cd AWSSDKSwiftCLI | |
swift run AWSSDKSwiftCLI generate-package-manifest .. | |
cd .. | |
echo "Manifest contents:" | |
cat Package.swift | |
- name: Build and Test SDK | |
run: | | |
cd AWSSDKSwiftCLI | |
swift run AWSSDKSwiftCLI test-aws-sdk .. --batches 10 | |
cd .. |