-
Notifications
You must be signed in to change notification settings - Fork 3
185 lines (153 loc) · 5.31 KB
/
checks.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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: Checks
on:
push:
branches: [ main ]
pull_request:
jobs:
test-unity:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
unityVersion:
- 2021.3.27f1
- 2022.3.2f1
steps:
- uses: actions/checkout@v4
- uses: testspace-com/setup-testspace@v1
with:
domain: ${{github.repository_owner}}
- name: Parse major unity version
id: major-unity-version
uses: actions/github-script@v7
env:
UNITY_VERSION: ${{ matrix.unityVersion }}
with:
result-encoding: string
script: return process.env['UNITY_VERSION'].substr(0, 4);
- name: Cache
uses: actions/cache@v4
with:
path: ResponsibleUnity/Library
key: ${{ steps.major-unity-version.outputs.result }}-Library-${{ hashFiles('com.beatwaves.responsible/**', 'ResponsibleUnity/**', 'src/Responsible.Tests/**') }}
restore-keys: |
${{ steps.major-unity-version.outputs.result }}-Library-
- name: Run tests
id: tests
uses: game-ci/unity-test-runner@v4
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
projectPath: ResponsibleUnity
unityVersion: ${{ matrix.unityVersion }}
coverageOptions: assemblyFilters:+Responsible,+Responsible.Editor
customParameters: -nographics -disable-assembly-updater
- name: Push to testspace
if: ${{ always() }}
run: testspace
[Unity-${{ matrix.unityVersion }}]${{ steps.tests.outputs.artifactsPath }}/editmode-results.xml
[Unity-${{ matrix.unityVersion }}]${{ steps.tests.outputs.artifactsPath }}/playmode-results.xml
- name: Push to codecov.io
if: ${{ always() }}
uses: codecov/codecov-action@v4
with:
flags: Unity${{ matrix.unityVersion }}
files: "${{ steps.tests.outputs.coveragePath }}/ResponsibleUnity-opencov/EditMode/TestCoverageResults_0000.xml,\
${{ steps.tests.outputs.coveragePath }}/ResponsibleUnity-opencov/EditMode/TestCoverageResults_0001.xml,\
${{ steps.tests.outputs.coveragePath }}/ResponsibleUnity-opencov/PlayMode/TestCoverageResults_0000.xml,\
${{ steps.tests.outputs.coveragePath }}/ResponsibleUnity-opencov/PlayMode/TestCoverageResults_0001.xml"
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Archive test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: Unity Test Results ${{ matrix.unityVersion }}
path: ${{ steps.tests.outputs.artifactsPath }}
- name: Archive coverage results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: Unity Coverage Results ${{ matrix.unityVersion }}
path: ${{ steps.tests.outputs.coveragePath }}
test-netstandard:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8'
- uses: testspace-com/setup-testspace@v1
with:
domain: ${{github.repository_owner}}
- name: Run Tests
id: run-tests
run: |
dotnet test --collect:"XPlat Code Coverage" --results-directory TestResults --settings runsettings.xml --logger "trx"
echo "::set-output name=tests::TestResults/*.trx"
- name: Push to testspace
if: ${{ always() }}
run: testspace [.NET]${{ steps.run-tests.outputs.tests }}
- name: Push to codecov.io
uses: codecov/codecov-action@v4
if: ${{ always() }}
with:
flags: netstandard
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Archive test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: netstandard Test Results
path: src/TestResults
test-mutation-core:
uses: ./.github/workflows/stryker.yml
with:
working-directory : src/Responsible.Tests
secrets:
STRYKER_KEY: ${{ secrets.STRYKER_KEY }}
test-mutation-gherkin:
uses: ./.github/workflows/stryker.yml
with:
working-directory: src/ResponsibleGherkin.Tests
secrets:
STRYKER_KEY: ${{ secrets.STRYKER_KEY }}
inspectcode:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8'
- name: dotnet restore
run: |
dotnet restore
dotnet tool restore
- name: Run ReSharper
run: ./inspectcode.sh
- name: Archive ReSharper run
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: ReSharper
path: src/inspect.xml
- name: ReSharper XML -> GitHub output
if: ${{ always() }}
uses: glassechidna/resharper-action@v1
with:
report: src/inspect.xml