-
-
Notifications
You must be signed in to change notification settings - Fork 1
207 lines (170 loc) · 7.03 KB
/
Copy pathci.yml
File metadata and controls
207 lines (170 loc) · 7.03 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
name: build-and-test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
defaults:
run:
working-directory: src
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
# All three target frameworks (#189). The SDKs provide the down-level
# reference packs and the matching runtimes, so `dotnet test` exercises the
# multi-targeted test project on net8.0, net9.0, and net10.0 in one pass.
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
# The test project multi-targets net8.0;net9.0;net10.0, so a single
# `dotnet test` run executes the full suite once per TFM on its own runtime.
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal --logger "trx;LogFileName=test-results.trx" --results-directory ./TestResults
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}
path: src/TestResults/*.trx
if-no-files-found: warn
retention-days: 7
# A dry run of the guards that stand between a tag and NuGet.org (#315). They
# all live on the release path, which no PR exercises — so without this job a
# breaking API change or a mis-packed package is only discovered by the nightly
# preview or by the release itself, long after review. Publishing is
# irreversible; the feedback belongs in the PR that causes it.
release-gates:
name: release-gates
runs-on: ubuntu-latest
defaults:
run:
working-directory: src
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
# The CHANGELOG extraction is a shell script, so it sits outside
# `dotnet test` and the coverage gate. Its size assertion is the one
# guarding against an over-cap release body publishing every package and
# only then failing to create the release.
- name: Test the release-notes extraction gate
working-directory: ${{ github.workspace }}
run: ./.github/scripts/test-extract-release-notes.sh
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Restore workloads
run: dotnet workload restore
# Packing is what runs package validation: each package is compared
# against its published baseline across every TFM, and any breaking API
# change fails here. See src/Directory.Build.props for the baseline-bump
# ritual and the suppression escape hatch.
- name: Pack (runs package validation against the published baseline)
run: dotnet pack --configuration Release --output ${{ github.workspace }}/nuget -p:ContinuousIntegrationBuild=true
- name: Validate packages
shell: pwsh
working-directory: ${{ github.workspace }}
run: ./.github/scripts/validate-packages.ps1 -NuGetDirectory "${{ github.workspace }}/nuget"
# The benchmark workflow only fires on `src/**`, so a dashboard-only change never
# reaches the report-backed run of this same script in benchmarks.yml. These are the
# structural checks, which need no measurements and cost seconds.
dashboard-coverage:
name: dashboard-coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
filter: tree:0
- name: Check dashboard wiring
run: node scripts/check_dashboard_coverage.js
# A link to an anchor that does not exist is well-formed markdown, so nothing else in
# the pipeline notices it and review reliably misses it — the wrong anchor for an
# entity-encoded generic heading is the *intuitive* one (#339).
doc-anchors:
name: doc-anchors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
filter: tree:0
- name: Pin the slug rule against GitHub's rendering
run: node scripts/check_doc_anchors.js --self-test
- name: Check markdown anchors and relative links
run: node scripts/check_doc_anchors.js
# The benchmark relevance gate decides whether an expensive sharded A/B run happens at
# all, so the C# lexer it rests on is pinned here rather than only exercised in the
# workflow it gates — where a wrong answer costs either runner hours or an unmeasured
# regression, and neither failure announces itself. The comment builder is pinned
# alongside it for the same reason: it decides which rows are called a regression, and
# a guard that is too permissive is indistinguishable from a clean report (#351).
benchmark-gate:
name: benchmark-gate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
filter: tree:0
- name: Pin the comment-stripping lexer
run: node scripts/benchmark_relevant_changes.js --self-test
- name: Pin the regression-flag rule
run: node scripts/benchmark_comment.js --self-test
aot-publish:
name: aot-publish (linux-x64, ${{ matrix.tfm }})
runs-on: ubuntu-latest
# Native-AOT-publish and run the smoke test on every shipped TFM (#189), so
# the AOT/trim verification covers net8.0, net9.0, and net10.0 — not just the
# lowest target.
strategy:
fail-fast: false
matrix:
tfm: [ net8.0, net9.0, net10.0 ]
defaults:
run:
working-directory: src
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
# Native AOT needs a platform linker; ubuntu-latest ships gcc/clang but the
# ILCompiler links against clang + zlib, so install them explicitly.
- name: Install Native AOT prerequisites
run: sudo apt-get update && sudo apt-get install -y clang zlib1g-dev
# Publishes the library + every generic instantiation the smoke test forces
# down to a native binary, for this TFM. Fails on any AOT/trim incompatibility.
- name: Publish AOT smoke test
run: dotnet publish Celerity.AotSmokeTest/Celerity.AotSmokeTest.csproj -f ${{ matrix.tfm }} -r linux-x64 -c Release
# Runs the native binary; its assertions exit non-zero on any behavioural
# regression under AOT, so a green run proves the collections work end-to-end.
- name: Run native AOT binary
run: ./Celerity.AotSmokeTest/bin/Release/${{ matrix.tfm }}/linux-x64/publish/Celerity.AotSmokeTest