5050
5151 - name : ⚙️ Setup GIT versioning
525253+ id : nbgv
5354 with :
5455 setAllVars : true
5556
6566 with :
6667 files : ' ["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj", "src/Directory.Build.props"]'
6768 env :
68- RELEASE_VERSION : ${{ env.NBGV_SimpleVersion }}${{ env.NBGV_PrereleaseVersion }}
69+ RELEASE_VERSION : ${{ steps.nbgv.outputs.SimpleVersion }}${{ steps.nbgv.outputs.PrereleaseVersion }}
6970 RELEASE_NOTES : ${{ steps.changelog_reader.outputs.changes }}
7071
7172 # Create the NuGet package in the folder from the environment variable NuGetDirectory
@@ -127,29 +128,37 @@ jobs:
127128 8.0.x
128129 9.0.x
129130
131+ - name : ⚙️ Restore packages and tools
132+ run : |
133+ dotnet restore
134+ dotnet tool restore
135+
130136 - name : 🧪 Run unit tests
131- run : dotnet test -c release -p:VSTestUseMSBuildOutput=false
137+ run : dotnet test -c release --no-restore
132138
133139 - name : 📛 Upload hang- and crash-dumps on test failure
134- if : failure()
135- uses : actions/upload-artifact@v3
140+ if : success() || failure()
141+ uses : actions/upload-artifact@v4
136142 with :
137143 if-no-files-found : ignore
138144 name : test-dumps
139145 path : |
140- **/*hangdump .dmp
141- **/*crashdump .dmp
146+ **/*.dmp
147+ **/*.dmp
142148
143- validate_template :
149+ validate-template :
144150 runs-on : ubuntu-latest
145151 needs : [ create-nuget ]
146152 steps :
147153 - uses : actions/checkout@v4
148154 with :
149155 fetch-depth : 0 # Get all history to allow automatic versioning using MinVer
150156
151- - name : Setup .NET
157+ - name : ⚙️ Setup dotnet
152158 uses : actions/setup-dotnet@v4
159+ with :
160+ dotnet-version : |
161+ 9.0.x
153162
154163 - uses : actions/download-artifact@v4
155164 with :
@@ -169,20 +178,31 @@ jobs:
169178 run : |
170179 dotnet new bunit --no-restore -o ${{ github.workspace }}/TemplateTestXunit
171180 echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestXunit/Directory.Build.props
181+ echo '<Project><PropertyGroup><ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally></PropertyGroup></Project>' >> ${{ github.workspace }}/TemplateTestXunit/Directory.Packages.props
172182 dotnet restore ${{ github.workspace }}/TemplateTestXunit --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
173183 dotnet test ${{ github.workspace }}/TemplateTestXunit
174184
185+ - name : ✔ Verify xUnit.v3 template
186+ run : |
187+ dotnet new bunit --framework xunitv3 --no-restore -o ${{ github.workspace }}/TemplateTestXunitv3
188+ echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestXunitv3/Directory.Build.props
189+ echo '<Project><PropertyGroup><ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally></PropertyGroup></Project>' >> ${{ github.workspace }}/TemplateTestXunitv3/Directory.Packages.props
190+ dotnet restore ${{ github.workspace }}/TemplateTestXunitv3 --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
191+ dotnet test ${{ github.workspace }}/TemplateTestXunitv3
192+
175193 - name : ✔ Verify NUnit template
176194 run : |
177195 dotnet new bunit --framework nunit --no-restore -o ${{ github.workspace }}/TemplateTestNunit
178196 echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestNunit/Directory.Build.props
197+ echo '<Project><PropertyGroup><ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally></PropertyGroup></Project>' >> ${{ github.workspace }}/TemplateTestNunit/Directory.Packages.props
179198 dotnet restore ${{ github.workspace }}/TemplateTestNunit --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
180199 dotnet test ${{ github.workspace }}/TemplateTestNunit
181200
182201 - name : ✔ Verify MSTest template
183202 run : |
184203 dotnet new bunit --framework mstest --no-restore -o ${{ github.workspace }}/TemplateTestMstest
185204 echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestMstest/Directory.Build.props
205+ echo '<Project><PropertyGroup><ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally></PropertyGroup></Project>' >> ${{ github.workspace }}/TemplateTestMstest/Directory.Packages.props
186206 dotnet restore ${{ github.workspace }}/TemplateTestMstest --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
187207 dotnet test ${{ github.workspace }}/TemplateTestMstest
188208
@@ -203,15 +223,23 @@ jobs:
203223
204224 - name : ⚙️ Setup GIT versioning
205225226+ id : nbgv
206227 with :
207228 setAllVars : true
208229
230+ - name : 🛠️ Get Changelog Entry
231+ id : changelog_reader
232+ uses : mindsers/changelog-reader-action@v2
233+ with :
234+ version : Unreleased
235+ path : ./CHANGELOG.md
236+
209237 - name : 🍥 Replace tokens in files
210238 uses : cschleiden/replace-tokens@v1
211239 with :
212240 files : ' ["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj", "src/Directory.Build.props", "docs/site/docfx.json"]'
213241 env :
214- RELEASE_VERSION : ${{ env.NBGV_SimpleVersion }}${{ env.NBGV_PrereleaseVersion }}
242+ RELEASE_VERSION : ${{ steps.nbgv.outputs.SimpleVersion }}${{ steps.nbgv.outputs.PrereleaseVersion }}
215243 RELEASE_NOTES : ${{ steps.changelog_reader.outputs.changes }}
216244
217245 - name : 📄 Build bUnit
@@ -241,7 +269,7 @@ jobs:
241269 release-preview :
242270 if : github.event_name == 'workflow_dispatch' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/v2')
243271 runs-on : ubuntu-latest
244- needs : [ validate-nuget, run-test, validate_template , validate-docs ]
272+ needs : [ validate-nuget, run-test, validate-template , validate-docs ]
245273 steps :
246274 - uses : actions/download-artifact@v4
247275 with :
0 commit comments