unity-test-runner/README.md

71 lines
2.1 KiB
Markdown
Raw Normal View History

2019-11-30 14:48:50 +00:00
# Unity - Test runner
2019-12-01 00:35:41 +00:00
[![Actions status](https://github.com/webbertakken/unity-test-runner/workflows/Actions%20%F0%9F%98%8E/badge.svg)](https://github.com/webbertakken/unity-test-runner/actions?query=branch%3Amaster+workflow%3A%22Actions+%F0%9F%98%8E%22)
2019-11-30 14:46:38 +00:00
[Github Action](https://github.com/features/actions)
to run tests for any Unity project.
This is a recommended step to prepare your pipeline for using the
[Build](https://github.com/webbertakken/unity-actions#build)
action from the
[Unity Actions](https://github.com/webbertakken/unity-actions)
2019-12-01 00:37:59 +00:00
collection. This action also requires the [activation](https://github.com/marketplace/actions/unity-activate) step.
2019-11-30 15:36:27 +00:00
2019-11-30 17:26:15 +00:00
## Documentation
See the
[Unity Actions](https://github.com/webbertakken/unity-actions)
collection repository for workflow documentation and reference implementation.
2019-11-30 15:36:27 +00:00
## Usage
Create or edit the file called `.github/workflows/activation.yml` and add a job to it.
```yaml
name: Test project
on: [push]
jobs:
testRunnerInAllModes:
name: Test all modes ✨
runs-on: ubuntu-latest
steps:
```
Configure the test runner as follows:
```yaml
# Configure test runner
- name: Run tests
id: myTestStep
uses: webbertakken/unity-test-runner@v1
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
# Choose: "all", "playmode", "editmode"
TEST_MODE: all
2019-11-30 15:57:58 +00:00
# Optional: Path to your project, leave blank for "./"
2019-11-30 15:36:27 +00:00
UNITY_PROJECT_PATH: relative/path/to/your/project
2019-11-30 15:57:58 +00:00
# Optional: Artifacts path, leave blank for "artifacts"
ARTIFACTS_PATH: store/artifacts/here
2019-11-30 15:36:27 +00:00
```
You use the id to **upload the artifacts** like so:
```yaml
# Upload artifacts
- name: Upload test results
uses: actions/upload-artifact@v1
with:
name: Test results
path: ${{ steps.myTestStep.outputs.artifactsPath }}
```
Commit and push your workflow definition.
## More actions
Visit
[Unity Actions](https://github.com/webbertakken/unity-actions)
to find related actions for Unity.