Skip to content

Commit

Permalink
Convert to composite (#7)
Browse files Browse the repository at this point in the history
* convert to composite
* updated readme content
  • Loading branch information
ivailop authored Jan 4, 2021
1 parent f921a08 commit bf26a9b
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 6,376 deletions.
12 changes: 0 additions & 12 deletions .eslintrc.js

This file was deleted.

6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ name: Testspace Action
on: [push, pull_request]

jobs:
units:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm ci
- run: npm run lint
test:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
49 changes: 40 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

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

# Testspace client Setup JavaScript Action
A GitHub Action used to install and configure the Testspace client used for publishing test content to [Testspace.com](https://testspace.com).
# Testspace client Setup Action
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).

## Usage
Setting up the Testspace client:
Expand All @@ -14,21 +14,27 @@ with:
token: ${{ secrets.TESTSPACE_TOKEN }} # optional, only required for private repos
```
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:
```
$ testspace results.xml
```

## Input
The Testspace client action requires a `domain` and optionally a token for pushing content.
The Testspace client action requires a `domain` and optionally a token for publishing test results.

* [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.
* [Testspace token](https://help.testspace.com/docs/dashboard/admin-user#account) is required when using a `private` repo.
* [Testspace access token](https://help.testspace.com/docs/dashboard/admin-user#account) is required when using a `private` repo.

## Example
The following hello world type of example:
## Examples
A few usage examples:

```
name: hello
name: CI
on:
push:
jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -37,12 +43,37 @@ jobs:
- uses: testspace-com/setup-testspace@v1
with:
domain: ${{github.repository_owner}}
- name: Push test results
- name: Publish Results to Testspace
run: |
testspace results.xml
if: always()
```

When using a **Matrix** it is recommended to use a `folder` to store the test results specific to each matric entry.

```
name: CI
on:
push:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
..
- name: Publish Results to Testspace
run: |
testspace [ ${{ matrix.os }} ]results.xml
```

When using the [source directory](https://help.testspace.com/docs/publish/push-data-results#source) to organize your test results in corresponding `folders`.

```
$ testspace results.xml{path/to/test-source}
```

For more information on Publishing test results refer to the help [Overview on publishing](http://help.testspace.com/docs/publish/overview).

## Contributing
Expand Down
38 changes: 36 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,39 @@ branding:
color: green
icon: terminal
runs:
using: 'node12'
main: 'dist/index.js'
using: 'composite'
steps:
- run: |
if [ `uname -m` != 'x86_64' ]; then echo 'Error: Not supported platform.' && exit 1; fi
case `uname -s` in
Linux)
folder=$HOME/bin
mkdir -p $folder
curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $folder
;;
Darwin)
folder=$HOME/bin
mkdir -p $folder
curl -fsSL https://testspace-client.s3.amazonaws.com/testspace-darwin.tgz | tar -zxvf- -C $folder
;;
*) # Windows
folder=$LOCALAPPDATA\Programs\testspace
mkdir -p "$folder"
curl -OsSL https://testspace-client.s3.amazonaws.com/testspace-windows.zip
unzip -q -o testspace-windows.zip -d "$folder"
rm testspace-windows.zip
;;
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
fi
testspace config url "${token}@${domain}"
shell: bash
Loading

0 comments on commit bf26a9b

Please sign in to comment.