2023-01-20 07:31:13 +00:00
|
|
|
name: Run Unity Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
workflow_call:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
RunUnityTests:
|
|
|
|
name: Run Unity Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
unityVersion:
|
|
|
|
- 2019.4.40f1
|
2023-05-25 02:03:06 +00:00
|
|
|
- 2020.3.48f1
|
2024-03-08 14:43:26 +00:00
|
|
|
- 2021.3.36f1
|
2024-04-10 18:53:17 +00:00
|
|
|
- 2022.3.24f1
|
2024-04-17 16:20:50 +00:00
|
|
|
- 2023.2.18f1
|
2023-01-20 07:31:13 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
2023-11-14 14:38:21 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-01-20 07:31:13 +00:00
|
|
|
|
|
|
|
# Do Not Enable Caching --- Library needs to be recompiled every time because Weaver
|
|
|
|
# Leaving this here for posterity to ensure we never turn this on.
|
|
|
|
#- name: Cache Library
|
|
|
|
# id: cache-library
|
|
|
|
# uses: actions/cache@v3
|
|
|
|
# with:
|
|
|
|
# path: Library
|
|
|
|
# key: Library-${{ matrix.unityVersion }}
|
|
|
|
|
|
|
|
- name: Run editor Tests
|
2024-04-15 13:55:38 +00:00
|
|
|
uses: game-ci/unity-test-runner@v4
|
2023-01-20 07:31:13 +00:00
|
|
|
|
|
|
|
# We can use the same license for all Unity versions
|
2024-04-15 13:55:38 +00:00
|
|
|
# See https://game.ci/docs/github/activation/
|
2023-01-20 07:31:13 +00:00
|
|
|
env:
|
|
|
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
2024-04-15 13:55:38 +00:00
|
|
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
|
|
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
2023-01-20 07:31:13 +00:00
|
|
|
|
|
|
|
# testMode is set to editMode (editor tests only) until we fix playmode tests (or eliminate them)
|
|
|
|
# `-stackTraceLogType None` speeds up the job and vastly shrinks the log output
|
|
|
|
# If a test actually fails, we'll diagnose it locally anyway, so the stacktrace doesn't really help
|
|
|
|
with:
|
|
|
|
projectPath: ./
|
|
|
|
testMode: editmode
|
|
|
|
unityVersion: ${{ matrix.unityVersion }}
|
|
|
|
customParameters: -stackTraceLogType None
|
|
|
|
|
2023-03-01 23:08:54 +00:00
|
|
|
- name: Archive test results
|
2024-01-28 20:26:41 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-12-26 12:17:04 +00:00
|
|
|
if: always()
|
2023-03-01 23:08:54 +00:00
|
|
|
with:
|
|
|
|
name: Test Results ${{ matrix.unityVersion }}
|
|
|
|
path: artifacts
|
|
|
|
|
|
|
|
- name: Publish test results
|
|
|
|
uses: MirrorNetworking/nunit-reporter@master
|
2023-12-26 12:17:04 +00:00
|
|
|
if: always()
|
2023-03-01 23:08:54 +00:00
|
|
|
with:
|
|
|
|
reportTitle: Test Report ${{ matrix.unityVersion }}
|
|
|
|
path: "artifacts/*.xml"
|
|
|
|
access-token: ${{ secrets.GITHUB_TOKEN }}
|