-
Notifications
You must be signed in to change notification settings - Fork 1
198 lines (164 loc) · 5.04 KB
/
pr_validation.yml
File metadata and controls
198 lines (164 loc) · 5.04 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
name: pr_validation
on:
push:
branches:
- master
- dev
- main
pull_request:
branches:
- master
- dev
- main
jobs:
test:
name: Test-${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: "Checkout"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
lfs: true
fetch-depth: 0
- name: "Install .NET SDK"
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7
with:
global-json-file: "./global.json"
- name: "Restore .NET tools"
run: dotnet tool restore
- name: "Update release notes"
shell: pwsh
run: |
./build.ps1
- name: "dotnet build"
run: dotnet build -c Release
- name: "dotnet test"
shell: bash
run: dotnet test -c Release
pack:
name: NuGet Pack
runs-on: ubuntu-latest
needs: test
steps:
- name: "Checkout"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
lfs: true
fetch-depth: 0
- name: "Install .NET SDK"
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7
with:
global-json-file: "./global.json"
- name: "dotnet pack"
run: dotnet pack -c Release -o ./bin/nuget
- name: "Upload NuGet Artifacts"
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: nuget-packages
path: ./bin/nuget/*.nupkg
retention-days: 7
slopwatch:
name: Slopwatch
runs-on: ubuntu-latest
needs: test
timeout-minutes: 10
steps:
- name: "Checkout"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
fetch-depth: 0
- name: "Install .NET SDK"
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7
with:
global-json-file: "./global.json"
- name: "Restore .NET tools"
run: dotnet tool restore
- name: "slopwatch analyze"
run: dotnet slopwatch analyze
script-lint:
name: Script Lint
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: "ShellCheck (bash)"
run: shellcheck scripts/install-skillserver.sh
- name: "Syntax check (PowerShell)"
shell: pwsh
run: |
$errors = $null
[System.Management.Automation.PSParser]::Tokenize(
(Get-Content -Raw scripts/install-skillserver.ps1), [ref]$errors) | Out-Null
if ($errors.Count -gt 0) {
$errors | ForEach-Object { Write-Error $_.Message }
exit 1
}
Write-Host "PowerShell syntax OK"
cli-publish:
name: CLI Publish Dry Run
runs-on: ubuntu-latest
needs: test
steps:
- name: "Checkout"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
lfs: true
fetch-depth: 0
- name: "Install .NET SDK"
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7
with:
global-json-file: "./global.json"
- name: "Publish CLI (trimmed, linux-x64)"
run: |
dotnet publish src/Netclaw.SkillServer.Cli/Netclaw.SkillServer.Cli.csproj \
-c Release \
-r linux-x64 \
--self-contained \
-p:PublishSingleFile=true \
-p:TrimmerSingleWarn=false \
-o ./publish/linux-x64
- name: "Check trim warnings"
run: |
dotnet publish src/Netclaw.SkillServer.Cli/Netclaw.SkillServer.Cli.csproj \
-c Release \
-r linux-x64 \
--self-contained \
-p:PublishSingleFile=true \
-p:TrimmerSingleWarn=false \
-p:TreatWarningsAsErrors=true \
-warnAsError:IL2026 -warnAsError:IL2057 \
-warnAsError:IL2067 -warnAsError:IL2075 \
-warnAsError:IL2096 -warnAsError:IL3050
- name: "Smoke test"
run: |
./publish/linux-x64/skillserver --version
./publish/linux-x64/skillserver --help
docker:
name: Docker Build
runs-on: ubuntu-latest
needs: test
steps:
- name: "Checkout"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
lfs: true
fetch-depth: 0
- name: "Install .NET SDK"
uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7
with:
global-json-file: "./global.json"
- name: "Set up Docker"
uses: docker/setup-docker-action@v4
with:
daemon-config: |
{
"debug": true,
"features": {
"containerd-snapshotter": true
}
}
- name: "Build Container Image"
run: dotnet publish src/SkillServer/SkillServer.csproj -c Release /t:PublishContainer