forked from Triad-Sector/Triad_Sector
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (73 loc) · 3.16 KB
/
Copy pathbuild-test-debug.yml
File metadata and controls
87 lines (73 loc) · 3.16 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
name: Build & Test Debug
# Triad: key PR runs on the PR number rather than the ref, and only ever cancel PR runs.
# Cancelling a merge_group entry fails the queue rather than superseding it, and cancelling a
# push run abandons the only test coverage main/staging/stable ever get.
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
on:
push:
branches: [ main, staging, stable ]
# Triad: changelog-bot commits touch only Resources/Changelog. Filter here rather than in
# a job `if`: concurrency is evaluated per run, so a run whose jobs all skip still cancels
# the merge commit's in-flight run. Keep this off `pull_request`, where a required check
# that never runs sits pending forever.
paths-ignore: [ 'Resources/Changelog/**' ]
merge_group:
pull_request:
types: [ opened, reopened, synchronize, ready_for_review ]
branches: [ main, staging, stable ]
jobs:
build:
if: github.event.pull_request.draft == false
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30 # Triad: this job takes ~10m; without a cap a hung test burns the 6h runner ceiling.
steps:
- name: Checkout Master
uses: actions/checkout@v7
- 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@v5
with:
dotnet-version: 10.0.x
- name: Install dependencies
run: dotnet restore
- name: Build Project
run: dotnet build --configuration DebugOpt --no-restore /p:WarningsAsErrors=nullable /m
# Triad: NUnit.TestOutputXml/WorkDirectory restored (upstream has them, we had dropped
# them). With NUnit.ConsoleOut=0 and no XML, a failed CI run left nothing to triage from.
- name: Run Content.Tests
run: dotnet test --no-build --configuration DebugOpt Content.Tests/Content.Tests.csproj -- NUnit.ConsoleOut=0 NUnit.TestOutputXml="logs" NUnit.WorkDirectory="$(pwd)/test_results"
- name: Run Content.IntegrationTests
shell: pwsh
run: |
$env:DOTNET_gcServer=1
dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj --filter "FullyQualifiedName!~ShipyardTest" -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed NUnit.TestOutputXml="logs" NUnit.WorkDirectory="$(pwd)/test_results"
# Triad: `if: always()` on purpose. The failing run is the one whose results we want.
- name: Archive NUnit3 test results.
if: always()
uses: actions/upload-artifact@v7
with:
name: nunit3-results-${{ matrix.os }}
path: test_results/*
retention-days: 7
compression-level: 9
ci-success:
name: Build & Test Debug
needs:
- build
runs-on: ubuntu-latest
steps:
- name: CI succeeded
run: exit 0