Skip to content

Commit bf26a9b

Browse files
authored
Convert to composite (#7)
* convert to composite * updated readme content
1 parent f921a08 commit bf26a9b

File tree

8 files changed

+76
-6376
lines changed

8 files changed

+76
-6376
lines changed

.eslintrc.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ name: Testspace Action
22
on: [push, pull_request]
33

44
jobs:
5-
units:
6-
runs-on: ubuntu-latest
7-
steps:
8-
- uses: actions/checkout@v2
9-
- run: npm ci
10-
- run: npm run lint
115
test:
126
runs-on: ${{ matrix.os }}
137
strategy:

README.md

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
![Testspace Action](https://github.com/testspace-com/setup-testspace/workflows/Testspace%20Action/badge.svg)
33

4-
# Testspace client Setup JavaScript Action
5-
A GitHub Action used to install and configure the Testspace client used for publishing test content to [Testspace.com](https://testspace.com).
4+
# Testspace client Setup Action
5+
A GitHub Action is used to install and configure the Testspace client used for publishing test results and reports to [Testspace.com](https://github.com/marketplace/testspace-com).
66

77
## Usage
88
Setting up the Testspace client:
@@ -14,21 +14,27 @@ with:
1414
token: ${{ secrets.TESTSPACE_TOKEN }} # optional, only required for private repos
1515
```
1616
17+
Once the client is setup for a job [test results](https://help.testspace.com/docs/publish/push-data-results#file-content) can be published to the Testspace server:
18+
19+
```
20+
$ testspace results.xml
21+
```
22+
1723
## Input
18-
The Testspace client action requires a `domain` and optionally a token for pushing content.
24+
The Testspace client action requires a `domain` and optionally a token for publishing test results.
1925

2026
* [Testspace domain](https://help.testspace.com/docs/dashboard/admin-signup) is the **organizational** name (*subdomain*) used when creating the account along with *.testspace.com*. The *.testspace.com* string is optional.
21-
* [Testspace token](https://help.testspace.com/docs/dashboard/admin-user#account) is required when using a `private` repo.
27+
* [Testspace access token](https://help.testspace.com/docs/dashboard/admin-user#account) is required when using a `private` repo.
2228

23-
## Example
24-
The following hello world type of example:
29+
## Examples
30+
A few usage examples:
2531

2632
```
27-
name: hello
33+
name: CI
2834
on:
2935
push:
3036
jobs:
31-
build:
37+
test:
3238
runs-on: ubuntu-latest
3339
steps:
3440
- uses: actions/checkout@v2
@@ -37,12 +43,37 @@ jobs:
3743
- uses: testspace-com/setup-testspace@v1
3844
with:
3945
domain: ${{github.repository_owner}}
40-
- name: Push test results
46+
- name: Publish Results to Testspace
4147
run: |
4248
testspace results.xml
4349
if: always()
4450
```
4551

52+
When using a **Matrix** it is recommended to use a `folder` to store the test results specific to each matric entry.
53+
54+
```
55+
name: CI
56+
on:
57+
push:
58+
jobs:
59+
test:
60+
runs-on: ${{ matrix.os }}
61+
strategy:
62+
matrix:
63+
os: [ubuntu-latest, macos-latest, windows-latest]
64+
steps:
65+
..
66+
- name: Publish Results to Testspace
67+
run: |
68+
testspace [ ${{ matrix.os }} ]results.xml
69+
```
70+
71+
When using the [source directory](https://help.testspace.com/docs/publish/push-data-results#source) to organize your test results in corresponding `folders`.
72+
73+
```
74+
$ testspace results.xml{path/to/test-source}
75+
```
76+
4677
For more information on Publishing test results refer to the help [Overview on publishing](http://help.testspace.com/docs/publish/overview).
4778

4879
## Contributing

action.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,39 @@ branding:
1212
color: green
1313
icon: terminal
1414
runs:
15-
using: 'node12'
16-
main: 'dist/index.js'
15+
using: 'composite'
16+
steps:
17+
- run: |
18+
if [ `uname -m` != 'x86_64' ]; then echo 'Error: Not supported platform.' && exit 1; fi
19+
case `uname -s` in
20+
Linux)
21+
folder=$HOME/bin
22+
mkdir -p $folder
23+
curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $folder
24+
;;
25+
Darwin)
26+
folder=$HOME/bin
27+
mkdir -p $folder
28+
curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-darwin.tgz | tar -zxvf- -C $folder
29+
;;
30+
*) # Windows
31+
folder=$LOCALAPPDATA\Programs\testspace
32+
mkdir -p "$folder"
33+
curl -OsSL https://testspace-client.s3.amazonaws.com/testspace-windows.zip
34+
unzip -q -o testspace-windows.zip -d "$folder"
35+
rm testspace-windows.zip
36+
;;
37+
esac
38+
echo "$folder" >> $GITHUB_PATH
39+
shell: bash
40+
- run: |
41+
testspace --version
42+
domain=${{ inputs.domain }}
43+
if [ "${domain%%.*}" == "$domain" ]; then domain="${domain}.testspace.com"; fi
44+
token=${{ inputs.token }}
45+
if [ "$token" ]; then
46+
echo "::add-mask::${{ inputs.token }}"
47+
if [ "${token%%:*}" == "$token" ]; then token="${token}:"; fi
48+
fi
49+
testspace config url "${token}@${domain}"
50+
shell: bash

0 commit comments

Comments
 (0)