Run tests for any Unity project
 
 
 
 
 
Go to file
Webber e2f2badc29 Update workflow to use with instead of env 2020-01-31 01:15:59 +01:00
.github/workflows Update workflow to use with instead of env 2020-01-31 01:15:59 +01:00
action Update workflow to use with instead of env 2020-01-31 01:15:59 +01:00
src Add custom parameters 2020-01-31 01:15:59 +01:00
unity-project-with-correct-tests Add test project to verify the action with 2019-11-30 17:24:17 +01:00
.dockerignore Add initial version 2019-11-30 17:24:17 +01:00
.editorconfig Add meta files 2020-01-31 01:15:59 +01:00
.eslintignore Add meta files 2020-01-31 01:15:59 +01:00
.eslintrc.json Add meta files 2020-01-31 01:15:59 +01:00
.gitignore Add meta files 2020-01-31 01:15:59 +01:00
.prettierignore Add meta files 2020-01-31 01:15:59 +01:00
.prettierrc.json Add meta files 2020-01-31 01:15:59 +01:00
.yarnrc Add meta files 2020-01-31 01:15:59 +01:00
CODE_OF_CONDUCT.md Add meta files 2020-01-31 01:15:59 +01:00
CONTRIBUTING.md Add meta files 2020-01-31 01:15:59 +01:00
LICENSE Add license (MIT) 2019-11-30 15:47:07 +01:00
README.md Add custom parameters 2020-01-31 01:15:59 +01:00
action.yml Add meta files 2020-01-31 01:15:59 +01:00
babel.config.js Add meta files 2020-01-31 01:15:59 +01:00
jest.config.js Add meta files 2020-01-31 01:15:59 +01:00
package.json Add meta files 2020-01-31 01:15:59 +01:00
yarn.lock Add meta files 2020-01-31 01:15:59 +01:00

README.md

Unity - Test runner

Actions status


GitHub Action to run tests for any Unity project.

Part of the Unity Actions collection.


This is a recommended step to prepare your pipeline for using the Build action.

Documentation

See the Unity Actions collection repository for workflow documentation and reference implementation.

Usage

Create or edit the file called .github/workflows/main.yml and add a job to it.

name: Test project
on: [push]
jobs:
  testRunnerInAllModes:
    name: Test all modes ✨
    runs-on: ubuntu-latest
    steps:

Configure the test runner as follows:

# Configure test runner
- name: Run tests
  id: myTestStep
  uses: webbertakken/unity-test-runner@v1.1
  env:
    # Choose: "all", "playmode", "editmode"
    TEST_MODE: all

    # Optional: Path to your project, leave blank for "./"
    PROJECT_PATH: relative/path/to/your/project

    # Optional: Artifacts path, leave blank for "artifacts"
    ARTIFACTS_PATH: store/artifacts/here

You use the id to upload the artifacts like so:

# Upload artifacts
- name: Upload test results
  uses: actions/upload-artifact@v1
  with:
    name: Test results
    path: ${{ steps.myTestStep.outputs.artifactsPath }}

customParameters

Custom parameters to configure the test run.

Parameters must start with a hyphen (-) and may be followed by a value (without hyphen).

Parameters without a value will be considered booleans (with a value of true).

example:

- uses: webbertakken/unity-test-runner@master
  with:
    customParameters: -profile SomeProfile -someBoolean -someValue exampleValue

required: false default: ""

Save your workflow

Commit and push your workflow definition.

More actions

Visit Unity Actions to find related actions for Unity.

Feel free to contribute.

Licence

MIT