forked from dead-space-server/dead-space-14
-
Notifications
You must be signed in to change notification settings - Fork 0
180 lines (151 loc) · 5.48 KB
/
Copy pathbuild-test-debug.yml
File metadata and controls
180 lines (151 loc) · 5.48 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
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
name: Build & Test Debug
on:
workflow_dispatch:
push:
branches: [ master, staging, stable ]
merge_group:
pull_request:
types: [ opened, reopened, synchronize, ready_for_review ]
branches: [ master, staging, stable ]
jobs:
plan-integration-shards:
if: github.actor != 'PJBot' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false)
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.plan.outputs.matrix }}
steps:
- name: Checkout Master
uses: actions/checkout@v4.2.2
- name: Generate integration shard matrix
id: plan
shell: bash
run: echo "matrix=$(python3 Tools/integration_test_shards.py --shards 10)" >> "$GITHUB_OUTPUT"
- name: Print integration shards
shell: bash
run: python3 Tools/integration_test_shards.py --shards 10 --pretty
content-tests:
if: github.actor != 'PJBot' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false)
runs-on: ubuntu-latest
name: Content.Tests
steps:
- name: Checkout Master
uses: actions/checkout@v4.2.2
- name: Setup Submodule
run: |
git submodule update --init --recursive
- name: Pull engine updates
uses: space-wizards/submodule-dependency@v0.1.5
- name: Update Engine Submodules
run: |
cd RobustToolbox/
git submodule update --init --recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: 10.0.x
- name: Install dependencies
run: dotnet restore Content.Tests/Content.Tests.csproj
- name: Build Content.Tests
run: dotnet build Content.Tests/Content.Tests.csproj --configuration DebugOpt --no-restore /m
- name: Run Content.Tests
run: >
dotnet test --no-build --configuration DebugOpt Content.Tests/Content.Tests.csproj
--logger "console;verbosity=normal"
--logger "trx;LogFileName=content-tests.trx"
--results-directory TestResults
-- NUnit.ConsoleOut=0
- name: Print Content.Tests failures
if: always()
shell: pwsh
run: ./.github/scripts/print-test-failures.ps1 -ResultsDirectory TestResults
- name: Upload Content.Tests results
if: always()
uses: actions/upload-artifact@v4
with:
name: content-tests-results
path: TestResults/
if-no-files-found: ignore
integration-tests:
if: github.actor != 'PJBot' && (github.event_name != 'pull_request' || github.event.pull_request.draft == false)
needs:
- plan-integration-shards
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.plan-integration-shards.outputs.matrix) }}
name: Integration Tests (${{ matrix.name }})
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout Master
uses: actions/checkout@v4.2.2
- name: Setup Submodule
run: |
git submodule update --init --recursive
- name: Pull engine updates
uses: space-wizards/submodule-dependency@v0.1.5
- name: Update Engine Submodules
run: |
cd RobustToolbox/
git submodule update --init --recursive
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.1.0
with:
dotnet-version: 10.0.x
- name: Install dependencies
run: dotnet restore Content.IntegrationTests/Content.IntegrationTests.csproj
- name: Build Content.IntegrationTests
run: dotnet build Content.IntegrationTests/Content.IntegrationTests.csproj --configuration DebugOpt --no-restore /m
- name: Print shard plan
shell: bash
run: |
echo "Shard: ${{ matrix.id }}"
echo "Estimated markers: ${{ matrix.tests }}"
echo "Units: ${{ matrix.units }}"
echo "Filter: ${{ matrix.filter }}"
- name: Run Content.IntegrationTests
shell: pwsh
env:
TEST_FILTER: ${{ matrix.filter }}
TEST_RESULTS_NAME: ${{ matrix.id }}.trx
run: |
New-Item -ItemType Directory -Force -Path TestResults | Out-Null
$env:DOTNET_gcServer=1
dotnet test Content.IntegrationTests/Content.IntegrationTests.csproj `
--no-build `
--configuration DebugOpt `
--filter "$env:TEST_FILTER" `
--logger "console;verbosity=normal" `
--logger "trx;LogFileName=$env:TEST_RESULTS_NAME" `
--results-directory TestResults `
-- NUnit.ConsoleOut=1 NUnit.MapWarningTo=Failed
- name: Print integration test failures
if: always()
shell: pwsh
run: ./.github/scripts/print-test-failures.ps1 -ResultsDirectory TestResults
- name: Upload integration test results
if: always()
uses: actions/upload-artifact@v4
with:
name: integration-test-results-${{ matrix.id }}
path: TestResults/
if-no-files-found: ignore
ci-success:
name: Build & Test Debug
if: ${{ always() && needs.plan-integration-shards.result != 'skipped' }}
needs:
- plan-integration-shards
- content-tests
- integration-tests
runs-on: ubuntu-latest
steps:
- name: CI succeeded
shell: bash
run: |
if [[ "${{ needs.content-tests.result }}" != "success" ]]; then
echo "content-tests finished with ${{ needs.content-tests.result }}"
exit 1
fi
if [[ "${{ needs.integration-tests.result }}" != "success" ]]; then
echo "integration-tests finished with ${{ needs.integration-tests.result }}"
exit 1
fi