/unity-test-publisher

Test publisher for unity tests

Primary LanguageTypeScriptMIT LicenseMIT

Unity Test Publisher

Action CI status Follow Twitter Join Discord

⚠️ This project is not affiliated with Unity Technologies. As well even tho this project is inspired by game-ci project it is not a part of Game CI community.

This is a simple js action to parse and present Unity Test Report generated by Unity Editor.

Unity Test Publisher Result

For usage example check unity_run_tests.yml or documentation below

Inspired by the beautiful action-surefire-report

Development

Install the dependencies

npm install

Run the tests & build

npm run all

Usage

You can now consume the action by referencing the v1 branch

uses: rainbow-duck-games/unity-test-publisher@v0.1.2
if: ${{ always() }} # Avoid skipping on failed tests
with:
  githubToken: ${{ secrets.GITHUB_TOKEN }}

Take in mind that the job should contain permission to write checks for this token. More information about GitHub permissions

jobs:
  job:
    name: 'Test job'
    permissions:
      checks: write

Please check unity_run_tests.yml to find real unity build & consume of the result

Full list of options

Keep in mind that this action provides reasonable default to be compatible with unity-test-runner. Most of these options required for advanced setups far from the default ones.

  • githubToken (required) - GITHUB_TOKEN, in most cases keep it as ${{ secrets.GITHUB_TOKEN }}
  • reportWorkspace - if this is empty action will work relative to GITHUB_WORKSPACE directory
  • reportPaths - 'glob expression to find Unity test reports, default - artifact/*.xml
  • workdirPrefix - prefix on build machine to ignore in report, default - /github/workspace/
  • checkName - check name for test reports. Change it if you use more than one publisher step, default - Test Results
  • checkFailedStatus - what status should be for failed check, default - failure, allowed values: success, failure, neutral, cancelled, skipped, timed_out, or action_required
  • failOnTestFailures - fail run if there were test failures, default - false
  • failIfNoTests - fail run if there were no test results found, default - true