forked from unitystation/unitystation
-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (110 loc) · 4.06 KB
/
test.yml
File metadata and controls
121 lines (110 loc) · 4.06 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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:
########## HOW TO UPDATE UNITY_LICENSE ##########
# The job below is only used to request a new activation file
#
# !!! WARNING: Use a throw away Unity account for this since anyone will have access to the license file !!!
#
# If you need a new one follow these steps:
# - Uncomment the job below and run it
# - Download the manual activation file that appears as an artifact in a zip (Unity_v20XX.x.alf).
# - Visit license.unity3d.com, sign in and upload it.
# - You should now receive your license file (Unity_v20XX.x.ulf) as a download.
# - Replace UnityLicense.ulf in the Tools directory with it.
# - Make sure LICENSE_FILE_PATH in the 'Setup license' step still points to it.
# # Request license file job
# requestManualActivationFile:
# name: Request manual activation file
# runs-on: ubuntu-latest
# steps:
# # Request manual activation file
# - name: Request manual activation file
# uses: webbertakken/unity-request-manual-activation-file@v1.1
# id: getManualLicenseFile
# with:
# unityVersion: 2020.1.6f1
# # Upload artifact (Unity_v20XX.X.XXXX.alf)
# - name: Expose as artifact
# uses: actions/upload-artifact@v1
# with:
# name: ${{ steps.getManualLicenseFile.outputs.filePath }}
# path: ${{ steps.getManualLicenseFile.outputs.filePath }}
# Perform unit testing
performTest:
name: Unit testing on ${{ matrix.unityVersion }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
projectPath:
- UnityProject
unityVersion:
# - 2019.3.15f1
- 2020.1.6f1
targetPlatform:
- StandaloneWindows64
steps:
# Checkout repository (required to test local actions)
- name: Checkout repository
uses: actions/checkout@v2.0.0
# Cache the library directory to speed up builds
- name: Cache library directory
uses: actions/cache@v2.1.5
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: webbertakken/unity-test-runner@v1.6
with:
customParameters: "-nographics"
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
artifactsPath: ./testReports/${{ matrix.targetPlatform }}
testMode: editmode
# Install dotnet
- name: Installing dotnet
if: always()
uses: actions/setup-dotnet@v1
with:
dotnet-version: "2.1.202"
# 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@v1
with:
name: Test results
path: ./testReports/${{ matrix.targetPlatform }}