Skip to content

Commit

Permalink
Merge branch 'main' of github.com:awslabs/aws-sdk-kotlin into feat-s3…
Browse files Browse the repository at this point in the history
…-express
  • Loading branch information
lauzadis committed Feb 19, 2024
2 parents 416fa6c + 2ee1a34 commit c07135a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/scripts/run-codebuild-batch-job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ error_exit() {
PROJECT_NAME=$1
# get the source version to be built (defaults to main branch if not specified)
SOURCE_VERSION=${2:-main}
SDK_PR=$3
SMITHY_PR=$4

export SDK_PR
export SMITHY_PR

echo "Starting CodeBuild project ${PROJECT_NAME}"

# dump all GITHUB_* environment variables to file and pass to start job
jq -n 'env | to_entries | [.[] | select(.key | startswith("GITHUB_"))] | [.[] | {name: .key, value:.value, type:"PLAINTEXT"}]' >/tmp/gh_env_vars.json
# dump all GITHUB_* & *_PR environment variables to file and pass to start job
jq -n 'env | to_entries | [.[] | select((.key | startswith("GITHUB_")) or (.key | endswith("_PR")))] | [.[] | {name: .key, value:.value, type:"PLAINTEXT"}]' >/tmp/gh_env_vars.json

START_RESULT=$(
aws codebuild start-build-batch \
Expand Down
33 changes: 32 additions & 1 deletion .github/workflows/codebuild-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ on:
branches:
- main
workflow_dispatch:
inputs:
aws-sdk-kotlin-pr:
description: aws-sdk-kotlin PR number (optional)
type: number
required: false
smithy-kotlin-pr:
description: smithy-kotlin PR number (optional)
type: number
required: false
check-pr:
description: I verified that the PRs are not running any malicious code (If running for an external contributor)
required: true
type: boolean
default: false

env:
SDK_PR: ${{ inputs.aws-sdk-kotlin-pr }}
SMITHY_PR: ${{ inputs.smithy-kotlin-pr }}

permissions:
id-token: write
Expand All @@ -19,6 +37,11 @@ jobs:
e2e-tests:
runs-on: ubuntu-latest
steps:
- name: Verify PRs are not running malicious code
if: ${{ (inputs.aws-sdk-kotlin-pr != '' || inputs.smithy-kotlin-pr != '') && inputs.check-pr == false }}
run: |
echo Please verify the PRs are not running any malicious code and mark the checkbox true when running the workflow
exit 1
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand All @@ -29,6 +52,7 @@ jobs:
uses: aws-actions/aws-codebuild-run-build@v1
with:
project-name: gh-aws-sdk-kotlin-e2e-tests
env-vars-for-codebuild: SDK_PR, SMITHY_PR
- name: Cancel build
if: ${{ cancelled() }}
env:
Expand All @@ -42,6 +66,11 @@ jobs:
service-check-batch:
runs-on: ubuntu-latest
steps:
- name: Verify PRs are not running malicious code
if: ${{ (inputs.aws-sdk-kotlin-pr != '' || inputs.smithy-kotlin-pr != '') && inputs.check-pr == false }}
run: |
echo Please verify the PRs are not running any malicious code and mark the checkbox true when running the workflow
exit 1
- name: Checkout sources
uses: actions/checkout@v2
- name: Configure AWS Credentials
Expand All @@ -52,7 +81,9 @@ jobs:
- name: Run Service Check Batch
id: svc-check-batch
run: |
.github/scripts/run-codebuild-batch-job.sh gh-aws-sdk-kotlin-svc-check-batch ${{ github.event.pull_request.head.sha }}
.github/scripts/run-codebuild-batch-job.sh \
gh-aws-sdk-kotlin-svc-check-batch \
${{ github.event.pull_request.head.sha }} ${{ inputs.aws-sdk-kotlin-pr }} ${{ inputs.smithy-kotlin-pr }}
- name: Cancel build
if: ${{ cancelled() }}
env:
Expand Down

0 comments on commit c07135a

Please sign in to comment.