Repository navigation
163 lines (137 loc) · 4.9 KB
/
Copy pathci.yml
File metadata and controls
163 lines (137 loc) · 4.9 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
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
permissions:
contents: read
jobs:
build-test:
name: Build & Test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: '10.0.x'
- name: Restore
run: dotnet restore CSharp_XISOStudio.sln
- name: Build (Release)
run: dotnet build CSharp_XISOStudio.sln -c Release --no-restore
- name: Test
if: matrix.os != 'ubuntu-latest'
run: dotnet test CSharp_XISOStudio.sln -c Release --no-build --logger "console;verbosity=minimal"
- name: Test (with coverage)
if: matrix.os == 'ubuntu-latest'
run: dotnet test CSharp_XISOStudio.sln -c Release --no-build --collect:"XPlat Code Coverage" --results-directory ./coverage --logger "console;verbosity=minimal"
- name: Upload coverage report
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v7
with:
name: coverage
path: coverage
if-no-files-found: error
inspectcode:
name: InspectCode
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: '10.0.x'
- name: Install JetBrains command-line tools (pinned to the local version)
run: |
dotnet tool install --global JetBrains.ReSharper.GlobalTools --version 2026.2.3.1
"$env:USERPROFILE\.dotnet\tools" | Out-File -FilePath $env:GITHUB_PATH -Append
- name: Run InspectCode
run: jb inspectcode --output=InspectCode.sarif --swea --jobs=0 CSharp_XISOStudio.sln
- name: Fail on InspectCode findings
shell: pwsh
run: |
$report = Get-Content InspectCode.sarif -Raw | ConvertFrom-Json
$results = @($report.runs[0].results)
if ($results.Count -gt 0) {
foreach ($result in $results) {
$location = $result.locations[0].physicalLocation
Write-Host "::error file=$($location.artifactLocation.uri),line=$($location.region.startLine)::$($result.ruleId): $($result.message.text)"
}
Write-Host "InspectCode reported $($results.Count) finding(s)."
exit 1
}
Write-Host "InspectCode: 0 findings."
- name: Upload report
if: always()
uses: actions/upload-artifact@v7
with:
name: inspectcode-sarif
path: InspectCode.sarif
if-no-files-found: warn
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Validate documentation navigation and links
shell: bash
run: |
set -euo pipefail
failed=0
for file in docs/*.md; do
page="$(basename "$file" .md)"
[[ "$page" == "_Sidebar" ]] && continue
if ! grep -q "$page" docs/_Sidebar.md; then
echo "::error file=docs/_Sidebar.md::$page is missing from the wiki side menu"
failed=1
fi
if ! grep -q "$page" docs/_layouts/default.html; then
echo "::error file=docs/_layouts/default.html::$page is missing from the Pages side menu"
failed=1
fi
done
while IFS= read -r target; do
if [[ ! -f "docs/$target" ]]; then
echo "::error::Broken documentation link: $target"
failed=1
fi
done < <(grep -rhoE '\]\([A-Za-z0-9_-]+\.md' docs/*.md | sed -E 's/^\]\(//' | sort -u)
exit "$failed"
- name: Build documentation site
uses: actions/jekyll-build-pages@v1
with:
source: ./docs
destination: ./_site
publish:
name: Publish ${{ matrix.rid }}
needs: [build-test, inspectcode, docs]
if: github.event_name != 'pull_request'
strategy:
fail-fast: false
matrix:
rid: [win-x64, win-arm64, linux-x64, linux-arm64, osx-x64, osx-arm64]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: '10.0.x'
- name: Publish ${{ matrix.rid }}
run: dotnet publish XISOStudio -c Release -r ${{ matrix.rid }} --self-contained false -p:PublishSingleFile=true -o artifacts/${{ matrix.rid }}
- name: Upload ${{ matrix.rid }} artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.rid }}
path: artifacts/${{ matrix.rid }}
if-no-files-found: error