diff --git a/.github/actions/setup-kat/action.yml b/.github/actions/setup-kat/action.yml new file mode 100644 index 0000000..0629be0 --- /dev/null +++ b/.github/actions/setup-kat/action.yml @@ -0,0 +1,33 @@ +name: Setup Kat +description: > + Prepare kat tool for use in CI + +runs: + using: composite + steps: + - name: Install AWS CLI + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y awscli + - name: Set up kat + shell: bash + run: | + 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) + + if [ -z "$kat_version" ]; then + echo "No versions of kat were found" + exit 1 + fi + echo "Downloading kat version $kat_version" + + aws s3 cp s3://kotlin-sdk-build-tools/kat-releases/$kat_version/kat-$kat_version.zip ./kat.zip + + echo "Unzipping kat tool" + unzip -qq ./kat.zip -d kat + + kat_binary_path="$PWD/kat/kat-$kat_version/bin" + export PATH="$kat_binary_path:$PATH" + echo "$kat_binary_path" >> $GITHUB_PATH + + echo "Installed kat version $(kat version)" || (echo "Failed to execute kat command" && exit 1) \ No newline at end of file