Skip to content

Commit

Permalink
Merge branch 'main' into day/bump-connections-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
dayaffe authored Dec 27, 2024
2 parents c06abc0 + 402f091 commit f13447c
Show file tree
Hide file tree
Showing 28 changed files with 382 additions and 324 deletions.
51 changes: 51 additions & 0 deletions .github/actions/checkout-aws-sdk-swift-composite-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: 'Checkout aws-sdk-swift composite action'
description: 'A composite action that sets up aws-sdk-swift for the workflow.'
inputs:
AUTOMATION_USER_SSH_PRIVATE_KEY:
description: 'SSH private key for the automation user'
required: true
STAGING_PARTNER_REPO:
description: 'The staging partner repository'
required: true
runs:
using: 'composite'
steps:
- name: Set up SSH key
if: ${{ github.repository != 'smithy-lang/smithy-swift' }}
run: |
mkdir -p ~/.ssh
echo "${{ inputs.AUTOMATION_USER_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
shell: bash
- name: Select staging aws-sdk-swift branch
if: ${{ github.repository != 'smithy-lang/smithy-swift' }}
run: |
cd smithy-swift
ORIGINAL_REPO_HEAD_REF="$GITHUB_HEAD_REF" \
DEPENDENCY_REPO_URL="[email protected]:${{ inputs.STAGING_PARTNER_REPO }}.git" \
./scripts/ci_steps/select_dependency_branch.sh
shell: bash
- name: Checkout staging aws-sdk-swift
if: ${{ github.repository != 'smithy-lang/smithy-swift' }}
uses: actions/checkout@v4
with:
repository: ${{ inputs.STAGING_PARTNER_REPO }}
ref: ${{ env.DEPENDENCY_REPO_SHA }}
path: aws-sdk-swift
ssh-key: ${{ inputs.AUTOMATION_USER_SSH_PRIVATE_KEY }}
- name: Select aws-sdk-swift branch
if: ${{ github.repository == 'smithy-lang/smithy-swift' }}
run: |
cd smithy-swift
ORIGINAL_REPO_HEAD_REF="$GITHUB_HEAD_REF" \
DEPENDENCY_REPO_URL="https://github.com/awslabs/aws-sdk-swift.git" \
./scripts/ci_steps/select_dependency_branch.sh
shell: bash
- name: Checkout aws-sdk-swift
if: ${{ github.repository == 'smithy-lang/smithy-swift' }}
uses: actions/checkout@v4
with:
repository: awslabs/aws-sdk-swift
ref: ${{ env.DEPENDENCY_REPO_SHA }}
path: aws-sdk-swift
30 changes: 30 additions & 0 deletions .github/actions/setup-common-tools-composite-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Setup Common Tools'
description: 'A composite action that caches Gradle, caches Swift, and sets up Java.'
runs:
using: 'composite'
steps:
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: 1-${{ runner.os }}-gradle-${{ hashFiles('settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
1-${{ runner.os }}-gradle-${{ hashFiles('settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
1-${{ runner.os }}-gradle-
- name: Cache Swift
uses: actions/cache@v4
with:
path: |
~/Library/Caches/org.swift.swiftpm
~/.cache/org.swift.swiftpm
key: 1-${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }}
restore-keys: |
1-${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }}
1-${{ runner.os }}-${{ matrix.xcode }}-spm-
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 17
1 change: 1 addition & 0 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
codegen:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ${{ matrix.os }}
name: Java ${{ matrix.java }} ${{ matrix.os }}
strategy:
Expand Down
172 changes: 34 additions & 138 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:

jobs:
apple-ci:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -65,31 +66,8 @@ jobs:
sudo xcodebuild -runFirstLaunch
- name: Checkout smithy-swift
uses: actions/checkout@v4
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: 1-${{ runner.os }}-gradle-${{ hashFiles('settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
1-${{ runner.os }}-gradle-${{ hashFiles('settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
1-${{ runner.os }}-gradle-
- name: Cache Swift
uses: actions/cache@v4
with:
path: |
~/Library/Caches/org.swift.swiftpm
~/.cache/org.swift.swiftpm
key: 1-${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }}
restore-keys: |
1-${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }}
1-${{ runner.os }}-${{ matrix.xcode }}-spm-
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 17
- name: Setup common tools
uses: ./.github/actions/setup-common-tools-composite-action
- name: Build & Run smithy-swift Kotlin Unit Tests
run: ./gradlew build
- name: Build & Run smithy-swift Swift Unit Tests
Expand All @@ -103,6 +81,7 @@ jobs:
| xcbeautify
apple-downstream:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -157,55 +136,24 @@ jobs:
sudo xcodebuild -runFirstLaunch
- name: Checkout smithy-swift
uses: actions/checkout@v4
- name: Select aws-sdk-swift branch
run: |
ORIGINAL_REPO_HEAD_REF="$GITHUB_HEAD_REF" \
DEPENDENCY_REPO_URL="https://github.com/awslabs/aws-sdk-swift.git" \
./scripts/ci_steps/select_dependency_branch.sh
- name: Checkout aws-sdk-swift
uses: actions/checkout@v4
with:
repository: awslabs/aws-sdk-swift
ref: ${{ env.DEPENDENCY_REPO_SHA }}
path: aws-sdk-swift
- name: Move aws-sdk-swift into place
run: mv aws-sdk-swift ..
- name: Cache Gradle
uses: actions/cache@v4
path: smithy-swift
- name: Checkout aws-sdk-swift with composite action
uses: ./smithy-swift/.github/actions/checkout-aws-sdk-swift-composite-action
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: 1-${{ runner.os }}-gradle-${{ hashFiles('settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
1-${{ runner.os }}-gradle-${{ hashFiles('settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
1-${{ runner.os }}-gradle-
- name: Cache Swift
uses: actions/cache@v4
with:
path: |
~/Library/Caches/org.swift.swiftpm
~/.cache/org.swift.swiftpm
key: 1-${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }}
restore-keys: |
1-${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }}
1-${{ runner.os }}-${{ matrix.xcode }}-spm-
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 17
AUTOMATION_USER_SSH_PRIVATE_KEY: ${{ secrets.AUTOMATION_USER_SSH_PRIVATE_KEY }}
STAGING_PARTNER_REPO: ${{ secrets.STAGING_PARTNER_REPO }}
- name: Setup common tools
uses: ./smithy-swift/.github/actions/setup-common-tools-composite-action
- name: Tools Versions
run: |
cd ../aws-sdk-swift
./scripts/ci_steps/log_tool_versions.sh
run: ./aws-sdk-swift/scripts/ci_steps/log_tool_versions.sh
- name: Prepare aws-sdk-swift Protocol & Unit Tests
run: |
cd ../aws-sdk-swift
cd aws-sdk-swift
./scripts/ci_steps/prepare_protocol_and_unit_tests.sh
- name: Build and Run aws-sdk-swift Unit Tests
run: |
cd ../aws-sdk-swift
cd aws-sdk-swift
set -o pipefail && \
NSUnbufferedIO=YES xcodebuild \
-scheme aws-sdk-swift-Package \
Expand All @@ -214,7 +162,7 @@ jobs:
| xcbeautify
- name: Build and Run aws-sdk-swift Protocol Tests
run: |
cd ../aws-sdk-swift/codegen
cd aws-sdk-swift/codegen
set -o pipefail && \
NSUnbufferedIO=YES xcodebuild \
-scheme aws-sdk-swift-protocol-tests-Package \
Expand All @@ -223,6 +171,7 @@ jobs:
| xcbeautify
linux-ci:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -235,46 +184,24 @@ jobs:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Checkout smithy-swift
uses: actions/checkout@v4
- name: Install openssl
run: |
if [ -x "$(command -v apt)" ]; then
apt-get update && apt-get install -y libssl-dev
else
yum install -y openssl-devel which
fi
- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: 1-${{ runner.os }}-gradle-${{ hashFiles('settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
1-${{ runner.os }}-gradle-${{ hashFiles('settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
1-${{ runner.os }}-gradle-
- name: Cache Swift
uses: actions/cache@v3
with:
path: |
~/Library/Caches/org.swift.swiftpm
~/.cache/org.swift.swiftpm
key: 1-${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }}
restore-keys: |
1-${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }}
1-${{ runner.os }}-${{ matrix.xcode }}-spm-
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: corretto
java-version: 17
- name: Setup common tools
uses: ./.github/actions/setup-common-tools-composite-action
- name: Build & Run Kotlin Unit Tests
run: ./gradlew build
- name: Build & Run Swift Unit Tests
run: swift test

linux-downstream:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -287,70 +214,39 @@ jobs:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Checkout Sources
uses: actions/checkout@v3
- name: Select aws-sdk-swift branch
run: |
ORIGINAL_REPO_HEAD_REF="$GITHUB_HEAD_REF" \
DEPENDENCY_REPO_URL="https://github.com/awslabs/aws-sdk-swift.git" \
./scripts/ci_steps/select_dependency_branch.sh
- name: Checkout aws-sdk-swift
uses: actions/checkout@v3
with:
repository: awslabs/aws-sdk-swift
ref: ${{ env.DEPENDENCY_REPO_SHA }}
path: aws-sdk-swift
- name: Move aws-sdk-swift into place
run: mv aws-sdk-swift ..
- name: Install openssl
run: |
if [ -x "$(command -v apt)" ]; then
apt-get update && apt-get install -y libssl-dev
else
yum install -y openssl-devel which
fi
- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: 1-${{ runner.os }}-gradle-${{ hashFiles('settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
1-${{ runner.os }}-gradle-${{ hashFiles('settings.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }}
1-${{ runner.os }}-gradle-
- name: Cache Swift
uses: actions/cache@v3
- name: Checkout smithy-swift
uses: actions/checkout@v4
with:
path: |
~/Library/Caches/org.swift.swiftpm
~/.cache/org.swift.swiftpm
key: 1-${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }}
restore-keys: |
1-${{ runner.os }}-${{ matrix.xcode }}-spm-${{ hashFiles('Package.swift') }}
1-${{ runner.os }}-${{ matrix.xcode }}-spm-
- name: Setup Java
uses: actions/setup-java@v3
path: smithy-swift
- name: Checkout aws-sdk-swift with composite action
uses: ./smithy-swift/.github/actions/checkout-aws-sdk-swift-composite-action
with:
distribution: corretto
java-version: 17
AUTOMATION_USER_SSH_PRIVATE_KEY: ${{ secrets.AUTOMATION_USER_SSH_PRIVATE_KEY }}
STAGING_PARTNER_REPO: ${{ secrets.STAGING_PARTNER_REPO }}
- name: Setup common tools
uses: ./smithy-swift/.github/actions/setup-common-tools-composite-action
- name: Tools Versions
run: |
cd ../aws-sdk-swift
./scripts/ci_steps/log_tool_versions.sh
run: ./aws-sdk-swift/scripts/ci_steps/log_tool_versions.sh
- name: Prepare aws-sdk-swift Protocol & Unit Tests
run: |
cd ../aws-sdk-swift
cd aws-sdk-swift
./scripts/ci_steps/prepare_protocol_and_unit_tests.sh
- name: Build and Run aws-sdk-swift Unit Tests
run: |
cd ../aws-sdk-swift
cd aws-sdk-swift
swift test
- name: Build and Run aws-sdk-swift Protocol Tests
run: |
export AWS_REGION=us-west-2
export AWS_ACCESS_KEY_ID=test-key-id
export AWS_SECRET_ACCESS_KEY=test-secret-access-key
cd ../aws-sdk-swift/codegen
cd aws-sdk-swift/codegen
swift test
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
ktlint:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand All @@ -16,6 +17,7 @@ jobs:
run: ./gradlew ktlint

swiftlint:
if: github.repository == 'smithy-lang/smithy-swift' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
container:
image: ghcr.io/realm/swiftlint:0.54.0
Expand Down
Loading

0 comments on commit f13447c

Please sign in to comment.