Skip to content

Commit 64f3cbf

Browse files
committed
Add setup-kat action
1 parent 71ae22d commit 64f3cbf

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Setup Kat
2+
description: >
3+
Prepare kat tool for use in CI
4+
5+
runs:
6+
using: composite
7+
steps:
8+
- name: Configure AWS Credentials
9+
uses: aws-actions/configure-aws-credentials@v4
10+
with:
11+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
12+
aws-region: us-west-2
13+
- name: Install AWS CLI
14+
shell: bash
15+
run: |
16+
sudo apt-get update
17+
sudo apt-get install -y awscli
18+
- name: Set up kat
19+
shell: bash
20+
run: |
21+
kat_version=$(aws s3 ls s3://kotlin-sdk-build-tools/kat-releases/ | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1)
22+
23+
if [ -z "$kat_version" ]; then
24+
echo "No versions of kat were found"
25+
exit 1
26+
fi
27+
echo "Downloading kat version $kat_version"
28+
29+
aws s3 cp s3://kotlin-sdk-build-tools/kat-releases/$kat_version/kat-$kat_version.zip ./kat.zip
30+
31+
unzip ./kat.zip kat
32+
cd kat/kat-$kat_version/bin
33+
34+
kat_binary_path=kat/kat-$kat_version/bin
35+
export PATH="$kat_binary_path:$PATH"
36+
echo $kat_binary_path >> $GITHUB_PATH
37+
38+
echo "Installed kat version $(kat version)"

0 commit comments

Comments
 (0)