72 lines
2.1 KiB
YAML
72 lines
2.1 KiB
YAML
name: Unity Tests
|
|
|
|
on:
|
|
workflow_dispatch: {}
|
|
push:
|
|
branches: ["**"]
|
|
paths:
|
|
- TestProjects/UnityMCPTests/**
|
|
- MCPForUnity/Editor/**
|
|
- .github/workflows/unity-tests.yml
|
|
|
|
jobs:
|
|
testAllModes:
|
|
# Guard: only run on upstream repo; skip on forks
|
|
if: github.repository_owner == 'CoplayDev'
|
|
name: Test in ${{ matrix.testMode }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
projectPath:
|
|
- TestProjects/UnityMCPTests
|
|
testMode:
|
|
- editmode
|
|
unityVersion:
|
|
- 2021.3.45f2
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
lfs: true
|
|
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: ${{ matrix.projectPath }}/Library
|
|
key: Library-${{ matrix.projectPath }}-${{ matrix.unityVersion }}
|
|
restore-keys: |
|
|
Library-${{ matrix.projectPath }}-
|
|
Library-
|
|
|
|
# Run domain reload tests first (they're [Explicit] so need explicit category)
|
|
- name: Run domain reload tests
|
|
uses: game-ci/unity-test-runner@v4
|
|
id: domain-tests
|
|
env:
|
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
with:
|
|
projectPath: ${{ matrix.projectPath }}
|
|
unityVersion: ${{ matrix.unityVersion }}
|
|
testMode: ${{ matrix.testMode }}
|
|
customParameters: -testCategory domain_reload
|
|
|
|
- name: Run tests
|
|
uses: game-ci/unity-test-runner@v4
|
|
id: tests
|
|
env:
|
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
with:
|
|
projectPath: ${{ matrix.projectPath }}
|
|
unityVersion: ${{ matrix.unityVersion }}
|
|
testMode: ${{ matrix.testMode }}
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: Test results for ${{ matrix.testMode }}
|
|
path: ${{ steps.tests.outputs.artifactsPath }}
|