-
-
Notifications
You must be signed in to change notification settings - Fork 69
73 lines (65 loc) · 2.2 KB
/
Copy pathrun-test.yml
File metadata and controls
73 lines (65 loc) · 2.2 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Run Tests
on:
workflow_call:
secrets:
unity_license:
required: true
access_token:
required: true
inputs:
unity_container:
required: true
type: string
cache_key:
required: true
type: string
cache_key_restore:
required: false
type: string
test_results_name:
required: true
type: string
jobs:
run_tests:
runs-on: ubuntu-latest
container: ${{ inputs.unity_container }}
steps:
- name: Activate unity
continue-on-error: true
env:
UNITY_LICENSE: ${{ secrets.unity_license }}
run: |
echo "$UNITY_LICENSE" | tr -d '\r' > UnityLicenseFile.ulf
unity-editor -nographics -logFile /dev/stdout -manualLicenseFile UnityLicenseFile.ulf -quit
- name: Checkout repository
uses: actions/checkout@v6
- name: Cache Library
id: cache-library
uses: actions/cache@v5
with:
path: Library
key: ${{ inputs.cache_key }}
restore-keys: ${{ inputs.cache_key_restore }}
- name: Run editor Tests
run: unity-editor -nographics -logFile /dev/stdout -runTests -testPlatform editmode -testResults Tests/editmode-results.xml -enableCodeCoverage -coverageResultsPath Tests -debugCodeOptimization
timeout-minutes: 20
- name: Run play Tests
run: unity-editor -nographics -logFile /dev/stdout -runTests -testPlatform playmode -testResults Tests/playmode-results.xml -enableCodeCoverage -coverageResultsPath Tests -debugCodeOptimization
timeout-minutes: 20
- name: Archive test results
uses: actions/upload-artifact@v7
if: always()
with:
name: ${{ inputs.test_results_name }}
path: Tests
- name: Fix git safe directory
if: always()
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Publish test results
uses: dorny/test-reporter@v3
if: always()
with:
name: ${{ inputs.test_results_name }}
path: "Tests/*.xml"
reporter: dotnet-nunit
token: ${{ secrets.access_token }}