Skip to content

Commit 18d6461

Browse files
committed
Add kat CI
1 parent a1d76f3 commit 18d6461

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/kat-transform.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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: 'smithy-kotlin'
29+
30+
- name: Configure AWS Credentials
31+
uses: aws-actions/configure-aws-credentials@v4
32+
with:
33+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
34+
aws-region: us-west-2
35+
36+
- name: Setup kat
37+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/setup-kat@main
38+
39+
- name: Build
40+
working-directory: ./smithy-kotlin
41+
shell: bash
42+
run: |
43+
pwd
44+
ls -lsa
45+
kat bump-version # Bump from `vNext-SNAPSHOT` to `vNext`. kat transform only works on non-SNAPSHOT versions
46+
./gradlew build
47+
./gradlew publishAllPublicationsToTestLocalRepository
48+
49+
- name: Transform
50+
working-directory: ./smithy-kotlin
51+
shell: bash
52+
run: |
53+
pwd
54+
ls -lsa
55+
kat brazil transform -i ./build/m2 -o ./transformed -t .brazil.json -v live
56+
57+
# Check for manifest file
58+
if [ ! -f "./transformed/brazil-import-manifest.json" ]; then
59+
echo "Error: brazil-import-manifest.json not found in the transformed artifact"
60+
exit 1
61+
fi
62+
63+
echo "Transformation succeeded!"

0 commit comments

Comments
 (0)