-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
57 lines (53 loc) · 2.09 KB
/
action.yml
File metadata and controls
57 lines (53 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Run Unity UTP Test Batch
description: Runs a batch of Unity UTP tests in a given Unity project.
inputs:
unity-project-path:
description: Absolute path to the Unity project.
required: true
build-target:
description: Build target to use.
required: true
build-args:
description: Additional build args.
required: false
default: ""
artifact-name:
description: Artifact name for uploaded test artifacts (UTP logs, Unity Editor/Player logs, and test results XML; must be unique per matrix job).
required: false
default: unity-tests-batch-utp-logs
runs:
using: composite
steps:
- name: Prepare test list and install packages
shell: bash
working-directory: ${{ inputs.unity-project-path }}
run: |
set -euo pipefail
tests_input="CompilerWarnings,CompilerErrors,BuildWarnings,BuildErrors,PlaymodeTestsErrors,EditmodeTestsErrors,EditmodeTestsPassing,EditmodeTestsSkipped,PlaymodeTestsPassing,PlaymodeTestsSkipped,EditmodeSuite,PlaymodeSuite"
echo "TESTS_INPUT=$tests_input" >> $GITHUB_ENV
needs_test_framework=false
if [[ "$tests_input" == *"PlaymodeTests"* || "$tests_input" == *"EditmodeTests"* || "$tests_input" == *"EditmodeSuite"* || "$tests_input" == *"PlaymodeSuite"* ]]; then
needs_test_framework=true
fi
npm install -g openupm-cli
openupm add com.utilities.buildpipeline
if [ "$needs_test_framework" = true ]; then
openupm add com.unity.test-framework
openupm add com.unity.test-framework.utp-reporter || true
fi
- name: Run tests
shell: bash
env:
UNITY_PROJECT_PATH: ${{ inputs.unity-project-path }}
BUILD_TARGET: ${{ inputs.build-target }}
BUILD_ARGS: ${{ inputs.build-args }}
continue-on-error: true
run: |
bash "${GITHUB_WORKSPACE}/.github/actions/scripts/run-utp-tests.sh"
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v6
with:
name: ${{ inputs.artifact-name }}
path: utp-artifacts/
if-no-files-found: ignore