forked from unitystation/unitystation
-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (80 loc) · 2.66 KB
/
test.yml
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Tests
on:
push:
branches:
- develop
paths:
- "Tools/UnityLicense.ulf"
- "UnityProject/**"
- ".github/workflows/**"
- "Docker/**"
pull_request:
branches:
- develop
paths:
- "Tools/UnityLicense.ulf"
- "UnityProject/**"
- ".github/workflows/**"
jobs:
# Perform unit testing
performTest:
name: Unit testing on ${{ matrix.unityVersion }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
projectPath:
- UnityProject
unityVersion:
- 2021.3.12f1
targetPlatform:
- StandaloneWindows64
steps:
# Checkout repository (required to test local actions)
- name: Checkout repository
uses: actions/checkout@v2
# Cache the library directory to speed up builds
- name: Cache library directory
uses: actions/cache@v2
with:
path: ${{ matrix.projectPath }}/Library
key: Library2-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}
restore-keys: |
Library2-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}
Library2-${{ matrix.projectPath }}-
Library2-
# Set the UNITY_LICENSE environment variable with contents of $LICENSE_FILE_PATH
- name: Setup license
env:
LICENSE_FILE_PATH: ./Tools/UnityLicense.ulf
run: |
echo 'UNITY_LICENSE<<LICENSE-EOF' >> "$GITHUB_ENV"
cat "$LICENSE_FILE_PATH" >> "$GITHUB_ENV"
printf "\nLICENSE-EOF" >> "$GITHUB_ENV"
# Run tests - only edit mode supported
# Note: exits with non-zero on legitimate test fails, "if: always()" is needed for reporting
- name: Run tests
uses: game-ci/unity-test-runner@v2
with:
customParameters: "-nographics"
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
artifactsPath: ./testReports/${{ matrix.targetPlatform }}
testMode: editmode
# Install dotnet
- name: Installing dotnet
if: always()
uses: actions/[email protected]
with:
dotnet-version: "5.0.405"
# Do the report magic
- name: Generate .html report
if: always()
run: sudo dotnet ./Tools/ExtentReports/ExtentReportsDotNetCLI.dll -i=testReports/${{ matrix.targetPlatform }}/editmode-results.xml -o testReports/${{ matrix.targetPlatform }}/
# Upload test results
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Test results
path: ./testReports/${{ matrix.targetPlatform }}