-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Make GH workflows pass in staging & refactor using composite a…
…ctions (#1848) * Update workflows so they pass in staging repo too. * Use composite action to reduce duplication --------- Co-authored-by: Sichan Yoo <[email protected]>
- Loading branch information
Showing
4 changed files
with
137 additions
and
99 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
.github/actions/checkout-smithy-swift-composite-action/action.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: 'Checkout smithy-swift composite action' | ||
description: 'A composite action that sets up smithy-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 != 'awslabs/aws-sdk-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 smithy-swift branch | ||
if: ${{ github.repository != 'awslabs/aws-sdk-swift' }} | ||
run: | | ||
cd aws-sdk-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 smithy-swift | ||
if: ${{ github.repository != 'awslabs/aws-sdk-swift' }} | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ inputs.STAGING_PARTNER_REPO }} | ||
ref: ${{ env.DEPENDENCY_REPO_SHA }} | ||
path: smithy-swift | ||
ssh-key: ${{ inputs.AUTOMATION_USER_SSH_PRIVATE_KEY }} | ||
- name: Select smithy-swift branch | ||
if: ${{ github.repository == 'awslabs/aws-sdk-swift' }} | ||
run: | | ||
cd aws-sdk-swift | ||
ORIGINAL_REPO_HEAD_REF="$GITHUB_HEAD_REF" \ | ||
DEPENDENCY_REPO_URL="https://github.com/smithy-lang/smithy-swift.git" \ | ||
./scripts/ci_steps/select_dependency_branch.sh | ||
shell: bash | ||
- name: Checkout smithy-swift | ||
if: ${{ github.repository == 'awslabs/aws-sdk-swift' }} | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: smithy-lang/smithy-swift | ||
ref: ${{ env.DEPENDENCY_REPO_SHA }} | ||
path: smithy-swift |
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
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
Oops, something went wrong.