Skip to content

Commit 564396f

Browse files
authored
feat: kat in CI (#1443)
1 parent 2874082 commit 564396f

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Kat Transform
2+
3+
on:
4+
pull_request:
5+
types: [ opened, synchronize, reopened, labeled, unlabeled ]
6+
branches: [ main ]
7+
8+
# Allow one instance of this workflow per pull request, and cancel older runs when new changes are pushed
9+
concurrency:
10+
group: kat-pr-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
permissions:
14+
id-token: write
15+
contents: read
16+
17+
env:
18+
RUN: ${{ github.run_id }}-${{ github.run_number }}
19+
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dkotlin.incremental=false"
20+
21+
jobs:
22+
verify-transform:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout sources
26+
uses: actions/checkout@v4
27+
with:
28+
path: 'aws-sdk-kotlin'
29+
30+
- name: Setup Build
31+
uses: ./aws-sdk-kotlin/.github/actions/setup-build
32+
33+
- name: Configure AWS Credentials
34+
uses: aws-actions/configure-aws-credentials@v4
35+
with:
36+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
37+
aws-region: us-west-2
38+
39+
- name: Setup kat
40+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/setup-kat@main
41+
42+
- name: Build
43+
working-directory: ./aws-sdk-kotlin
44+
shell: bash
45+
run: |
46+
pwd
47+
ls -lsa
48+
kat bump-version # Bump from `vNext-SNAPSHOT` to `vNext`. kat transform only works on non-SNAPSHOT versions
49+
./gradlew build
50+
./gradlew publishAllPublicationsToTestLocalRepository
51+
52+
- name: Transform
53+
working-directory: ./aws-sdk-kotlin
54+
shell: bash
55+
run: |
56+
pwd
57+
ls -lsa
58+
kat brazil transform -i ./build/m2 -o ./transformed -t .brazil.json -v live -m ./codegen/sdk/packages.json
59+
60+
# Check for manifest file
61+
if [ ! -f "./transformed/brazil-import-manifest.json" ]; then
62+
echo "Error: brazil-import-manifest.json not found in the transformed artifact"
63+
exit 1
64+
fi
65+
66+
echo "Transformation succeeded!"

0 commit comments

Comments
 (0)