2019-11-30 14:48:50 +00:00
|
|
|
# Unity - Test runner
|
2019-12-01 00:35:41 +00:00
|
|
|
[](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
|
|
|
|
2019-12-03 22:12:31 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
GitHub Action to
|
|
|
|
[run tests](https://github.com/marketplace/actions/unity-test-runner)
|
|
|
|
for any Unity project.
|
|
|
|
|
|
|
|
Part of the
|
|
|
|
[Unity Actions](https://github.com/webbertakken/unity-actions)
|
|
|
|
collection.
|
|
|
|
|
|
|
|
---
|
2019-11-30 14:46:38 +00:00
|
|
|
|
|
|
|
This is a recommended step to prepare your pipeline for using the
|
|
|
|
[Build](https://github.com/webbertakken/unity-actions#build)
|
2020-01-29 20:49:35 +00:00
|
|
|
action.
|
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
|
|
|
|
|
2019-12-01 00:38:59 +00:00
|
|
|
Create or edit the file called `.github/workflows/main.yml` and add a job to it.
|
2019-11-30 15:36:27 +00:00
|
|
|
|
|
|
|
```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
|
2019-12-14 17:23:29 +00:00
|
|
|
uses: webbertakken/unity-test-runner@v1.1
|
2019-11-30 15:36:27 +00:00
|
|
|
env:
|
|
|
|
# Choose: "all", "playmode", "editmode"
|
2019-12-14 17:23:29 +00:00
|
|
|
TEST_MODE: all
|
2019-11-30 15:36:27 +00:00
|
|
|
|
2019-11-30 15:57:58 +00:00
|
|
|
# Optional: Path to your project, leave blank for "./"
|
2019-12-14 17:23:29 +00:00
|
|
|
PROJECT_PATH: relative/path/to/your/project
|
2019-11-30 15:36:27 +00:00
|
|
|
|
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.
|
2019-12-03 22:22:07 +00:00
|
|
|
|
|
|
|
Feel free to contribute.
|
|
|
|
|
|
|
|
## Licence
|
|
|
|
|
|
|
|
[MIT](./LICENSE)
|