Skip to content

Commit 2eafcdf

Browse files
authored
misc: add setup-kat action (#52)
1 parent 057089a commit 2eafcdf

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Setup Kat
2+
description: >
3+
Prepare kat tool for use in CI
4+
5+
runs:
6+
using: composite
7+
steps:
8+
- name: Install AWS CLI
9+
shell: bash
10+
run: |
11+
sudo apt-get update
12+
sudo apt-get install -y awscli
13+
- name: Set up kat
14+
shell: bash
15+
run: |
16+
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)
17+
18+
if [ -z "$kat_version" ]; then
19+
echo "No versions of kat were found"
20+
exit 1
21+
fi
22+
echo "Downloading kat version $kat_version"
23+
24+
aws s3 cp s3://kotlin-sdk-build-tools/kat-releases/$kat_version/kat-$kat_version.zip ./kat.zip
25+
26+
echo "Unzipping kat tool"
27+
unzip -qq ./kat.zip -d kat
28+
29+
kat_binary_path="$PWD/kat/kat-$kat_version/bin"
30+
export PATH="$kat_binary_path:$PATH"
31+
echo "$kat_binary_path" >> $GITHUB_PATH
32+
33+
echo "Installed kat version $(kat version)" || (echo "Failed to execute kat command" && exit 1)

0 commit comments

Comments
 (0)