Skip to content

Commit 44f34f0

Browse files
authored
Merge pull request #1327 from bUnit-dev/release/v1.26
Release of new minor version v1.26
2 parents e4befc2 + 4e35e13 commit 44f34f0

File tree

255 files changed

+116457
-35016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

255 files changed

+116457
-35016
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
]
1010
},
1111
"docfx": {
12-
"version": "2.73.2",
12+
"version": "2.74.1",
1313
"commands": [
1414
"docfx"
1515
]

.github/workflows/ci.yml

Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- v2
8+
paths:
9+
- 'src/**'
10+
- 'tests/**'
11+
12+
pull_request:
13+
types:
14+
- opened
15+
- synchronize
16+
- reopened
17+
18+
workflow_dispatch:
19+
20+
concurrency:
21+
group: verification-${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
22+
cancel-in-progress: true
23+
24+
env:
25+
VSTEST_CONNECTION_TIMEOUT: 180
26+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
27+
DOTNET_NOLOGO: true
28+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
29+
NUGET_DIRECTORY: ${{ github.workspace }}/nuget
30+
NUGET_PACKAGES_ARTIFACT: nuget-packages
31+
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1
32+
TERM: xterm
33+
34+
jobs:
35+
create-nuget:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer
41+
42+
# Install the .NET SDK indicated in the global.json file
43+
- name: ⚙️ Setup dotnet versions
44+
uses: actions/setup-dotnet@v4
45+
with:
46+
dotnet-version: |
47+
3.1.x
48+
5.0.x
49+
6.0.x
50+
7.0.x
51+
8.0.x
52+
53+
- name: ⚙️ Setup GIT versioning
54+
uses: dotnet/[email protected]
55+
with:
56+
setAllVars: true
57+
58+
- name: 🛠️ Get Changelog Entry
59+
id: changelog_reader
60+
uses: mindsers/changelog-reader-action@v2
61+
with:
62+
version: Unreleased
63+
path: ./CHANGELOG.md
64+
65+
- name: 🛠️ Update tokens in project files
66+
uses: cschleiden/replace-tokens@v1
67+
with:
68+
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj", "src/Directory.Build.props"]'
69+
env:
70+
RELEASE_VERSION: ${{ env.NBGV_SimpleVersion }}${{ env.NBGV_PrereleaseVersion }}
71+
RELEASE_NOTES: ${{ steps.changelog_reader.outputs.changes }}
72+
73+
# Create the NuGet package in the folder from the environment variable NuGetDirectory
74+
- run: |
75+
dotnet pack src/bunit/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
76+
dotnet pack src/bunit.core/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
77+
dotnet pack src/bunit.web/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
78+
dotnet pack src/bunit.template/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
79+
dotnet pack src/bunit.generators/ -c release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
80+
81+
# Publish the NuGet package as an artifact, so they can be used in the following jobs
82+
- uses: actions/upload-artifact@v4
83+
with:
84+
name: ${{ env.NUGET_PACKAGES_ARTIFACT }}
85+
if-no-files-found: error
86+
compression-level: 0 # nuget files already compressed
87+
retention-days: 7
88+
path: ${{ env.NUGET_DIRECTORY }}/*.nupkg
89+
90+
validate-nuget:
91+
runs-on: ubuntu-latest
92+
needs: [ create-nuget ]
93+
steps:
94+
- name: Setup .NET
95+
uses: actions/setup-dotnet@v4
96+
97+
- uses: actions/download-artifact@v4
98+
with:
99+
name: ${{ env.NUGET_PACKAGES_ARTIFACT }}
100+
path: ${{ env.NUGET_DIRECTORY }}
101+
102+
- name: Install nuget validator
103+
run: dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global
104+
105+
# Validate metadata and content of the NuGet package
106+
# https://www.nuget.org/packages/Meziantou.Framework.NuGetPackageValidation.Tool#readme-body-tab
107+
# If some rules are not applicable, you can disable them
108+
# using the --excluded-rules or --excluded-rule-ids option
109+
- name: Validate package
110+
shell: pwsh
111+
run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NUGET_DIRECTORY }}/*.nupkg") --excluded-rules IconMustBeSet
112+
113+
run-test:
114+
strategy:
115+
fail-fast: false
116+
matrix:
117+
os: [ubuntu-latest, macos-latest, windows-latest]
118+
runs-on: ${{ matrix.os }}
119+
120+
steps:
121+
- name: 🛒 Checkout repository
122+
uses: actions/checkout@v4
123+
with:
124+
fetch-depth: 0
125+
126+
- name: ⚙️ Setup dotnet versions
127+
uses: actions/setup-dotnet@v4
128+
with:
129+
dotnet-version: |
130+
3.1.x
131+
5.0.x
132+
6.0.x
133+
7.0.x
134+
8.0.x
135+
136+
- name: 🧪 Run unit tests
137+
run: dotnet test -c release --blame --blame-crash --blame-hang
138+
139+
- name: 📛 Upload hang- and crash-dumps on test failure
140+
if: failure()
141+
uses: actions/upload-artifact@v3
142+
with:
143+
if-no-files-found: ignore
144+
name: test-dumps
145+
path: |
146+
**/*hangdump.dmp
147+
**/*crashdump.dmp
148+
149+
validate_template:
150+
runs-on: ubuntu-latest
151+
needs: [ create-nuget ]
152+
steps:
153+
- uses: actions/checkout@v4
154+
with:
155+
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer
156+
157+
- name: Setup .NET
158+
uses: actions/setup-dotnet@v4
159+
160+
- uses: actions/download-artifact@v4
161+
with:
162+
name: ${{ env.NUGET_PACKAGES_ARTIFACT }}
163+
path: ${{ env.NUGET_DIRECTORY }}
164+
165+
- name: ⚙️ Setup GIT versioning
166+
uses: dotnet/[email protected]
167+
with:
168+
setAllVars: true
169+
170+
- name: ✳ Install bUnit template
171+
run: |
172+
dotnet new install bunit.template::${NBGV_SimpleVersion}${NBGV_PrereleaseVersion} --nuget-source ${{ env.NUGET_DIRECTORY }}
173+
174+
- name: ✔ Verify xUnit template
175+
run: |
176+
dotnet new bunit --no-restore -o ${{ github.workspace }}/TemplateTestXunit
177+
echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestXunit/Directory.Build.props
178+
dotnet restore ${{ github.workspace }}/TemplateTestXunit --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
179+
dotnet test ${{ github.workspace }}/TemplateTestXunit
180+
181+
- name: ✔ Verify NUnit template
182+
run: |
183+
dotnet new bunit --framework nunit --no-restore -o ${{ github.workspace }}/TemplateTestNunit
184+
echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestNunit/Directory.Build.props
185+
dotnet restore ${{ github.workspace }}/TemplateTestNunit --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
186+
dotnet test ${{ github.workspace }}/TemplateTestNunit
187+
188+
- name: ✔ Verify MSTest template
189+
run: |
190+
dotnet new bunit --framework mstest --no-restore -o ${{ github.workspace }}/TemplateTestMstest
191+
echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestMstest/Directory.Build.props
192+
dotnet restore ${{ github.workspace }}/TemplateTestMstest --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
193+
dotnet test ${{ github.workspace }}/TemplateTestMstest
194+
195+
validate-docs:
196+
runs-on: ubuntu-latest
197+
steps:
198+
- name: 🛒 Checkout repository
199+
uses: actions/checkout@v4
200+
with:
201+
fetch-depth: 0
202+
203+
- name: ⚙️ Setup dotnet versions
204+
uses: actions/setup-dotnet@v4
205+
with:
206+
dotnet-version: |
207+
3.1.x
208+
5.0.x
209+
6.0.x
210+
7.0.x
211+
8.0.x
212+
213+
- name: ⚙️ Setup GIT versioning
214+
uses: dotnet/[email protected]
215+
with:
216+
setAllVars: true
217+
218+
- name: 🍥 Replace tokens in files
219+
uses: cschleiden/replace-tokens@v1
220+
with:
221+
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj", "src/Directory.Build.props"]'
222+
env:
223+
RELEASE_VERSION: ${{ env.NBGV_SimpleVersion }}${{ env.NBGV_PrereleaseVersion }}
224+
RELEASE_NOTES: ${{ steps.changelog_reader.outputs.changes }}
225+
226+
- name: 📄 Build bUnit
227+
run: dotnet build -c release
228+
229+
- name: 🧪 Run sample unit tests
230+
run: dotnet test docs/samples/samples.sln
231+
232+
- name: 📄 Build docs
233+
working-directory: ./docs/site
234+
run: |
235+
dotnet tool install --global docfx --version 2.74.1
236+
docfx metadata --logLevel error
237+
docfx build --logLevel warning --warningsAsErrors
238+
239+
dependency-review:
240+
runs-on: ubuntu-latest
241+
permissions:
242+
contents: read
243+
if: github.event_name == 'pull_request' && github.repository_owner == 'bunit-dev'
244+
steps:
245+
- name: 'Checkout Repository'
246+
uses: actions/checkout@v4
247+
- name: 'Dependency Review'
248+
uses: actions/dependency-review-action@v3
249+
250+
release-preview:
251+
if: github.event_name == 'workflow_dispatch' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/v2')
252+
runs-on: ubuntu-latest
253+
needs: [ validate-nuget, run-test, validate_template, validate-docs ]
254+
steps:
255+
- uses: actions/download-artifact@v4
256+
with:
257+
name: ${{ env.NUGET_PACKAGES_ARTIFACT }}
258+
path: ${{ env.NUGET_DIRECTORY }}
259+
260+
- name: Setup .NET Core
261+
uses: actions/setup-dotnet@v4
262+
263+
- name: 🛠️ Upload library to GitHub Package Repository
264+
run: dotnet nuget push ${{ env.NUGET_DIRECTORY }}/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/bunit-dev/index.json --skip-duplicate --no-symbols
265+
266+
- name: 🛠️ Upload library to NuGet.org repository
267+
run: dotnet nuget push ${{ env.NUGET_DIRECTORY }}/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols

.github/workflows/docs-deploy.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ on:
1515

1616
workflow_dispatch:
1717

18+
env:
19+
VSTEST_CONNECTION_TIMEOUT: 180
20+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
21+
DOTNET_NOLOGO: true
22+
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1
23+
TERM: xterm
24+
1825
jobs:
1926
deploy:
2027
name: 📃 Deploy new version bunit.dev
@@ -55,13 +62,14 @@ jobs:
5562

5663
- name: 🛠️ Update tokens in project files
5764
uses: cschleiden/replace-tokens@v1
58-
env:
59-
RELEASE-VERSION: ${{ steps.changelog_reader.outputs.version }}
6065
with:
61-
files: '["docs/site/docfx.json", "docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj"]'
66+
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj", "src/Directory.Build.props"]'
67+
env:
68+
RELEASE_VERSION: ${{ steps.changelog_reader.outputs.version }}
69+
RELEASE_NOTES: ${{ steps.changelog_reader.outputs.changes }}
6270

6371
- name: ⚙️ Setup dotnet versions
64-
uses: actions/setup-dotnet@v3
72+
uses: actions/setup-dotnet@v4
6573
with:
6674
dotnet-version: |
6775
3.1.x
@@ -76,15 +84,17 @@ jobs:
7684
echo "TERM=xterm" >> $GITHUB_ENV
7785
7886
- name: 🛠️ Building bUnit
79-
run: dotnet build /p:PublicRelease=true
87+
run: dotnet build /p:PublicRelease=true -c release
8088

81-
- name: 🛠️ Verfiy docs samples
89+
- name: 🛠️ Verify docs samples
8290
run: dotnet test docs/samples/samples.sln
8391

84-
- name: 🛠️ Building docs
92+
- name: 📄 Building docs
93+
working-directory: ./docs/site
8594
run: |
86-
dotnet tool update -g docfx --version 2.67.0
87-
docfx docs/site/docfx.json
95+
dotnet tool install --global docfx --version 2.74.1
96+
docfx metadata --logLevel error
97+
docfx build
8898
8999
- name: 🛠️ Deploy to GitHub Pages
90100
if: success()

0 commit comments

Comments
 (0)