-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 2.82 KB
/
Copy pathquality.yml
File metadata and controls
71 lines (62 loc) · 2.82 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
name: Code Quality
on:
push:
pull_request:
jobs:
quality:
name: quality-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
# The dashboard SPA is generated, not committed: Vortex.Dashboard.API embeds whatever Vite
# writes to its Assets\ folder, and its BuildDashboardFrontend target runs `npm run build`
# before doing so. Without a toolchain here that target has nothing to run and the gate fails
# rather than silently embedding an empty dashboard.
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: Vortex.Dashboard.Web/package-lock.json
- name: Install dashboard front-end dependencies
working-directory: Vortex.Dashboard.Web
run: npm ci
# Explicit and solution-wide. The gate's inner steps all pass --no-restore, and building
# Vortex.Main only restores its own dependency graph — the test projects are not in it, so
# `dotnet test Vortex.Cloud.sln --no-restore` had no assets to work from on a clean checkout.
- name: Restore
run: dotnet restore Vortex.Cloud.sln
- name: Restore local tools
run: dotnet tool restore
# Phase 2 promotes the selected nullable/reliability diagnostics
# (CS8602;CS8604;CS8618;CA2000;CA2012;CA2201;IDE0005;IDE0058) from warnings to errors.
# Verified green on the whole solution before being turned on here; the remaining historical
# warning categories stay warnings on purpose, so the ratchet moves one notch rather than
# turning every legacy warning into a build break at once.
- name: Quality gate (build + tests + format + analyzers)
run: >-
dotnet build Vortex.Main/Vortex.Main.csproj
-t:VortexCloudQualityGate
-p:VortexAIPolicyPhase=2
# `dotnet list package --vulnerable` exits 0 even when it finds something, so the output has
# to be inspected. Transitive packages are included: that is where most advisories land.
- name: Scan for vulnerable packages
shell: bash
run: |
set -euo pipefail
dotnet list Vortex.Cloud.sln package --vulnerable --include-transitive \
--no-restore > vulnerable.txt 2>&1 || true
cat vulnerable.txt
if grep -qiE '(Critical|High|Moderate|Low)$|has the following vulnerable packages' vulnerable.txt; then
echo "::error::Vulnerable NuGet packages detected. See the report above."
exit 1
fi
echo "No vulnerable packages reported."