Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aajtodd committed Oct 6, 2023
1 parent 57ccb8a commit 05a63bd
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/codegen-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,30 +69,32 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
- name: Install deps

- name: Install deps and setup environment
run: |
npm install -g diff2html-cli@${{ env.DIFF2HTML_VERSION }}
env | sort
- name: Generate code for head ref
run: |
# store off a copy of head ref of ci.py, otherwise base ref generation will use a different version of this script
cp $GITHUB_WORKSPACE/aws-sdk-kotlin/.github/scripts/codegen-diff-revisions.py $GITHUB_WORSKPACE/codegen-diff-revisions.py
CODEGEN_DIFF_REVISIONS=$GITHUB_WORSKPACE/codegen-diff-revisions.py
REPO_TOOLS=$GITHUB_WORKSPACE/aws-kotlin-repo-tools
SMITHY_KOTLIN_DIR=$GITHUB_WORKSPACE/smithy-kotlin
SDK_DIR=$GITHUB_WORKSPACE/aws-sdk-kotlin
- name: Generate code for head ref
run: |
branch=$(python3 $REPO_TOOLS/scripts/ci.py get-branch $SDK_DIR)
echo "using branch $branch"
python3 $REPO_TOOLS/scripts/ci.py -v set-branch --branch $branch $SMITHY_KOTLIN_DIR
pushd $SDK_DIR
git checkout -b $HEAD_BRANCH_NAME
.github/scripts/codegen-diff-revisions.py codegen --bootstrap ${{ env.PREVIEW_SERVICES }}
$CODEGEN_DIFF_REVISIONS codegen --bootstrap ${{ env.PREVIEW_SERVICES }}
popd
- name: Generate code for base ref
run: |
REPO_TOOLS=$GITHUB_WORKSPACE/aws-kotlin-repo-tools
SMITHY_KOTLIN_DIR=$GITHUB_WORKSPACE/smithy-kotlin
SDK_DIR=$GITHUB_WORKSPACE/aws-sdk-kotlin
branch=$GITHUB_BASE_REF
echo "checkout smithy-kotlin at $branch"
echo "checkout smithy-kotlin at base ref: $branch"
pushd $SMITHY_KOTLIN_DIR
git switch -f main
python3 $REPO_TOOLS/scripts/ci.py -v set-branch --branch $branch
Expand All @@ -102,14 +104,13 @@ jobs:
git switch -f main
python3 $REPO_TOOLS/scripts/ci.py -v set-branch --branch $branch
git checkout -b $BASE_BRANCH_NAME
.github/scripts/codegen-diff-revisions.py codegen --bootstrap ${{ env.PREVIEW_SERVICES }}
$CODEGEN_DIFF_REVISIONS codegen --bootstrap ${{ env.PREVIEW_SERVICES }}
popd
- name: Generate diffs
run: |
SDK_DIR=$GITHUB_WORKSPACE/aws-sdk-kotlin
pushd $SDK_DIR
.github/scripts/codegen-diff-revisions.py generate-diffs \
$CODEGEN_DIFF_REVISIONS generate-diffs \
--head-sha ${{ github.event.pull_request.head.sha }} \
--base-sha ${{ github.event.pull_request.base.sha }} \
$BASE_BRANCH_NAME $HEAD_BRANCH_NAME
Expand Down

0 comments on commit 05a63bd

Please sign in to comment.