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 : Configure JDK
40+ uses : actions/setup-java@v3
41+ with :
42+ distribution : ' corretto'
43+ java-version : 17
44+ cache : ' gradle'
45+
46+ - name : Build
47+ working-directory : ./smithy-kotlin
48+ shell : bash
49+ run : |
50+ pwd
51+ ls -lsa
52+ kat bump-version # Bump from `vNext-SNAPSHOT` to `vNext`. kat transform only works on non-SNAPSHOT versions
53+ kat bump-version --property codegenVersion
54+ ./gradlew build
55+ ./gradlew publishAllPublicationsToTestLocalRepository
56+
57+ - name : Transform
58+ working-directory : ./smithy-kotlin
59+ shell : bash
60+ run : |
61+ pwd
62+ ls -lsa
63+ kat brazil transform -i ./build/m2 -o ./transformed -t .brazil.json -v live
64+
65+ # Check for manifest file
66+ if [ ! -f "./transformed/brazil-import-manifest.json" ]; then
67+ echo "Error: brazil-import-manifest.json not found in the transformed artifact"
68+ exit 1
69+ fi
70+
71+ echo "Transformation succeeded!"
0 commit comments