-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yml
62 lines (62 loc) · 2.28 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: 'Testspace Setup CLI'
description: 'Setup Testspace client to publish CI results from workflow to Dashboard; report flaky tests, metrics, graphs, and analytics'
author: 'S2 Technologies, Inc.'
inputs:
domain:
description: 'Testspace domain name'
required: true
token:
description: 'Testspace access token (required for private repos only)'
required: false
config-args:
description: 'Custom "config" arguments'
required: false
branding:
color: green
icon: terminal
runs:
using: 'composite'
steps:
- run: |
base_url=https://testspace-client.s3.amazonaws.com
if [ "$TESTSPACE_CLIENT_VER" ]; then version="-$TESTSPACE_CLIENT_VER"; fi
case `uname -s` in
Linux)
folder=$HOME/bin
mkdir -p $folder
arch=`uname -m`
if [ "$arch" != "x86_64" ]; then version="-${arch}${version}"; fi
curl -fsSL ${base_url}/testspace-linux${version}.tgz | tar -zxvf- -C $RUNNER_TEMP
cp -f -p -u $RUNNER_TEMP/testspace $folder
;;
Darwin)
folder=$HOME/bin
mkdir -p $folder
arch=`uname -m`
if [ "$arch" != "x86_64" ]; then version="-${arch}${version}"; fi
curl -fsSL ${base_url}/testspace-darwin${version}.tgz | tar -zxvf- -C $RUNNER_TEMP
rsync -t -u $RUNNER_TEMP/testspace $folder
;;
*) # Windows
folder=$LOCALAPPDATA\Programs\testspace
mkdir -p "$folder"
curl -OsSL ${base_url}/testspace-windows${version}.zip
unzip -q -o testspace-windows${version}.zip -d $RUNNER_TEMP
rm testspace-windows${version}.zip
cp -f -p -u $RUNNER_TEMP/testspace.exe "$folder"
;;
esac
echo "$folder" >> $GITHUB_PATH
shell: bash
- run: |
testspace --version
domain=${{ inputs.domain }}
if [ "${domain%%.*}" == "$domain" ]; then domain="${domain}.testspace.com"; fi
token=${{ inputs.token }}
if [ "$token" ]; then
echo "::add-mask::${{ inputs.token }}"
if [ "${token%%:*}" == "$token" ]; then token="${token}:"; fi
domain="${token}@${domain}"
fi
testspace config url "${domain}" ${{ inputs.config-args }}
shell: bash