diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b85862..ed9137f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,19 +1,17 @@ name: Testspace Action on: push: - paths-ignore: - - '**.md' - - 'docs/**' pull_request: - paths-ignore: - - '**.md' - - 'docs/**' + # Monthly, so a change in GitHub's runner images shows up here (and the badge stays current). + schedule: + - cron: '0 6 1 * *' + workflow_dispatch: jobs: test: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-13, macos-latest, windows-latest] + os: [ubuntu-latest, macos-15-intel, macos-latest, windows-latest] steps: - uses: actions/checkout@v4 - name: Testspace client install & config diff --git a/README.md b/README.md index 6f02fe7..990c2e6 100644 --- a/README.md +++ b/README.md @@ -1,63 +1,67 @@ +[![Testspace Action](https://github.com/testspace-com/setup-testspace/actions/workflows/ci.yml/badge.svg)](https://github.com/testspace-com/setup-testspace/actions/workflows/ci.yml) -[![Testspace Action](https://github.com/testspace-com/setup-testspace/actions/workflows/ci.yml/badge.svg)](https://github.com/testspace-com/setup-testspace/actions/workflows/ci.yml) +# Setup Testspace +This [GitHub Action](https://github.com/features/actions) installs and configures the Testspace client, so a workflow can publish its test results, code coverage and static analysis to [Testspace](https://www.testspace.com) with one command. -# Testspace client Setup Action -This [GitHub Action](https://github.com/features/actions) is used to install and configure the Testspace client for publishing test results to [Testspace.com](https://github.com/marketplace/testspace-com). +- Reads JUnit XML (which most test frameworks write, some with a reporter), NUnit, xUnit.net and Visual Studio TRX, plus coverage and static analysis files. +- Runs on Linux and macOS runners (x86-64 and arm64) and Windows runners. -- Supports `JUnit` and other results formats such as `NUnit`, `TRX`, etc. -- Supports `Linux`, `maxOS`, and `Windows` - -[LIVE DASHBOARD](https://demo.testspace.com) +See the results of a real workflow in the [live demo](https://s2.testspace.com/projects/EXAMPLE:RESULTS). It needs no account. ## Usage -Publish test results, code coverage, and other artifacts with one command. Seamless integration with your CI. Manage all your test status with a single dashboard providing history, metrics, and other types of insights. - - ```yml - steps: - - uses: testspace-com/setup-testspace@v1 - with: - domain: ${{github.repository_owner}} - token: ${{ secrets.TESTSPACE_TOKEN }} # optional, only required for private repos - .. - - name: Publish Results to Testspace - run: testspace path/to/*.xml + +```yml +steps: + - uses: actions/checkout@v4 + - uses: testspace-com/setup-testspace@v1 + with: + domain: ${{ github.repository_owner }} + token: ${{ secrets.TESTSPACE_TOKEN }} # private repositories only + # ... build and run your tests ... + - name: Publish results to Testspace + run: testspace "test-results/*.xml" coverage.xml + if: always() ``` -#### Setup -The Testspace client action requires a `domain` and optionally a token for publishing test results. +`if: always()` publishes the results when tests fail, which is when they matter most. -* [Testspace domain](https://help.testspace.com/dashboard/admin-signup) is the **organizational** name (*subdomain*) used when creating the account along with *.testspace.com*. The *.testspace.com* string is optional. -* [Testspace access token](https://help.testspace.com/dashboard/admin-user#account) is required when using a `private` repo. +### Inputs -#### Push -Simple to publish test results, code coverage, custom metrics, etc., all with a single line command using the Testspace client. +| Input | Required | Description | +|---|---|---| +| `domain` | yes | Your Testspace Organization's name, the subdomain you [signed up](https://help.testspace.com/get-started/sign-up) with (`.testspace.com` is optional). | +| `token` | private repositories | An [access token](https://help.testspace.com/organization/users-and-permissions#account) or a Project's [push token](https://help.testspace.com/projects/connected#push-token), stored as a repository secret. Public repositories don't need one. | +| `config-args` | no | Extra arguments for the client's `config` command (see the [client reference](https://help.testspace.com/reference/testspace-client)). | -- Automatically supports a `branch-based` process, forks, and `pull requests` -- Can also publish code coverage, and other artifacts (see [here](https://help.testspace.com/publish/push-data-results#file-content) for details) -- Aggregates results for [jobs](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobs), [matrix](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategy), and even **multiple workflows** +To pin the client's version, set the `TESTSPACE_CLIENT_VER` environment variable. On pull requests, Testspace reads the pull request's number with `jq`, which GitHub's hosted runners include; on a self-hosted runner without it, the action shows a warning. -This sample repo - https://github.com/testspace-com/hello.publish - demonstrates support for jobs, matrix, and multiple workflows all executing based on the same commit. All of the published results are aggregated together as a single result set. +### Jobs, matrix builds and several workflows -[CLICK HERE](http://testspace-com.testspace.com/projects/testspace-com:hello.publish/spaces/main) to review the *test results* from the `Hello Publish` sample. +Each job pushes its own files, and Testspace combines everything published for the same commit into one result. Give each job's results their own folder so they stay apart: + +```yml +- run: testspace "[${{ matrix.os }}]test-results/*.xml" + if: always() +``` -## Testspace Dashboard -[Testpace.com](https://testspace.com) enables monitoring the status of the software, regardless of the testing method. All the metrics; test results, code coverage, defects, requirements, etc., are collected and analyzed together. Testspace Dashboard provides: +See [Matrix](https://help.testspace.com/publish/push-data-add-to-ci#matrix) and the [GitHub Actions setup](https://help.testspace.com/publish/push-data-add-to-ci#github-actions) in the help, and [what can be published](https://help.testspace.com/publish/push-data-results#file-content). -* Built-in [metrics/graphs](https://help.testspace.com/dashboard/space-metrics) -* Extensive [Failure Tracking Management](https://help.testspace.com/dashboard/space-failures) -* Automatic [Flaky analysis](https://help.testspace.com/dashboard/space-failures#failure-state) -* [Insights](https://help.testspace.com/dashboard/project-insights) for process improvements +## What you get -For more information on Publishing test results refer to the help [Overview on publishing](http://help.testspace.com/publish/overview). +![The Failures view of a result: failing tests marked New, Flaky or Consistent](./docs/images/failures.png "Failures in the live demo") -![Dashboard](./docs/images/publish.dashboard.png "Dashboard") +- **Failure Tracking:** every failing test is tracked from one run to the next, marked New, [Flaky](https://help.testspace.com/results/failures#flaky) or Consistent, until it passes again. +- **Health:** each result is [Healthy or Unhealthy](https://help.testspace.com/results/health) against the checks you set, posted as a status check on the commit and pull request. +- **Every branch and pull request** gets its own results, with each test's history across them. +- **Trends:** a [monthly view](https://help.testspace.com/results/trends) of whether quality is getting better, with what needs attention. +More: [Automated test results](https://www.testspace.com/test-results-dashboard) · [Visualizing GitHub Actions test results](https://www.testspace.com/blog/visualizing-test-results-with-github-actions) · [Publishing overview](https://help.testspace.com/publish/overview) -## Contributing -Contributions are encouraged following the [Contribution Guide](CONTRIBUTING.md). +## Contributing +Contributions are welcome; see the [Contribution Guide](CONTRIBUTING.md). ## License -This code is released under the [MIT License](LICENSE). +Released under the [MIT License](LICENSE). diff --git a/action.yml b/action.yml index 1dc402d..349b8c5 100644 --- a/action.yml +++ b/action.yml @@ -1,5 +1,5 @@ name: 'Testspace Setup CLI' -description: 'Setup Testspace client to publish CI results from workflow to Dashboard; report flaky tests, metrics, graphs, and analytics' +description: 'Install and configure the Testspace client to publish test results, coverage and static analysis from your workflow' author: 'S2 Technologies, Inc.' inputs: domain: diff --git a/docs/images/failures.png b/docs/images/failures.png new file mode 100644 index 0000000..5838e6d Binary files /dev/null and b/docs/images/failures.png differ diff --git a/docs/images/publish.dashboard.png b/docs/images/publish.dashboard.png deleted file mode 100644 index e7b17d3..0000000 Binary files a/docs/images/publish.dashboard.png and /dev/null differ diff --git a/docs/images/publish.hello.png b/docs/images/publish.hello.png deleted file mode 100644 index 3fde575..0000000 Binary files a/docs/images/publish.hello.png and /dev/null differ