Skip to content

Commit

Permalink
Merge pull request #1571 from bUnit-dev/release/v1.32
Browse files Browse the repository at this point in the history
Release of new minor version v1.32
  • Loading branch information
egil authored Oct 4, 2024
2 parents f8674d7 + 1fb99ac commit cb3fa8f
Show file tree
Hide file tree
Showing 59 changed files with 721 additions and 581 deletions.
13 changes: 11 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@
"version": "1.10.175",
"commands": [
"dotnet-serve"
]
],
"rollForward": false
},
"docfx": {
"version": "2.76.0",
"commands": [
"docfx"
]
],
"rollForward": false
},
"dotnet-dump": {
"version": "8.0.532401",
"commands": [
"dotnet-dump"
],
"rollForward": false
}
}
}
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ dotnet_diagnostic.S112.severity = none # S112: General exceptions should never b
dotnet_diagnostic.S1075.severity = suggestion # S1075: URIs should not be hardcoded
dotnet_diagnostic.S1186.severity = suggestion # S1186: Methods should not be empty
dotnet_diagnostic.S2292.severity = suggestion # S2292: Trivial properties should be auto-implemented
dotnet_diagnostic.S3267.severity = suggestion # S3267: Convert foreach loop to LINQ query
dotnet_diagnostic.S4158.severity = none # BUGGY with C#9 code - doesnt understand local methods

# Razor specific rules
Expand Down
35 changes: 26 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
- name: ⚙️ Setup GIT versioning
uses: dotnet/[email protected]
id: nbgv
with:
setAllVars: true

Expand All @@ -68,7 +69,7 @@ jobs:
with:
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj", "src/Directory.Build.props"]'
env:
RELEASE_VERSION: ${{ env.NBGV_SimpleVersion }}${{ env.NBGV_PrereleaseVersion }}
RELEASE_VERSION: ${{ steps.nbgv.outputs.SimpleVersion }}${{ steps.nbgv.outputs.PrereleaseVersion }}
RELEASE_NOTES: ${{ steps.changelog_reader.outputs.changes }}

# Create the NuGet package in the folder from the environment variable NuGetDirectory
Expand Down Expand Up @@ -136,20 +137,25 @@ jobs:
8.0.x
9.0.x
- name: ⚙️ Restore packages and tools
run: |
dotnet restore
dotnet tool restore
- name: 🧪 Run unit tests
run: dotnet test -c release -p:VSTestUseMSBuildOutput=false
run: dotnet test -c release --no-restore

- name: 📛 Upload hang- and crash-dumps on test failure
if: failure()
uses: actions/upload-artifact@v3
if: success() || failure()
uses: actions/upload-artifact@v4
with:
if-no-files-found: ignore
name: test-dumps
path: |
**/*hangdump.dmp
**/*crashdump.dmp
**/*.dmp
**/*.dmp
validate_template:
validate-template:
runs-on: ubuntu-latest
needs: [ create-nuget ]
steps:
Expand Down Expand Up @@ -178,20 +184,23 @@ jobs:
run: |
dotnet new bunit --no-restore -o ${{ github.workspace }}/TemplateTestXunit
echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestXunit/Directory.Build.props
echo '<Project><PropertyGroup><ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally></PropertyGroup></Project>' >> ${{ github.workspace }}/TemplateTestXunit/Directory.Packages.props
dotnet restore ${{ github.workspace }}/TemplateTestXunit --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
dotnet test ${{ github.workspace }}/TemplateTestXunit
- name: ✔ Verify NUnit template
run: |
dotnet new bunit --framework nunit --no-restore -o ${{ github.workspace }}/TemplateTestNunit
echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestNunit/Directory.Build.props
echo '<Project><PropertyGroup><ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally></PropertyGroup></Project>' >> ${{ github.workspace }}/TemplateTestNunit/Directory.Packages.props
dotnet restore ${{ github.workspace }}/TemplateTestNunit --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
dotnet test ${{ github.workspace }}/TemplateTestNunit
- name: ✔ Verify MSTest template
run: |
dotnet new bunit --framework mstest --no-restore -o ${{ github.workspace }}/TemplateTestMstest
echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestMstest/Directory.Build.props
echo '<Project><PropertyGroup><ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally></PropertyGroup></Project>' >> ${{ github.workspace }}/TemplateTestMstest/Directory.Packages.props
dotnet restore ${{ github.workspace }}/TemplateTestMstest --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
dotnet test ${{ github.workspace }}/TemplateTestMstest
Expand All @@ -216,15 +225,23 @@ jobs:
- name: ⚙️ Setup GIT versioning
uses: dotnet/[email protected]
id: nbgv
with:
setAllVars: true

- name: 🛠️ Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: Unreleased
path: ./CHANGELOG.md

- name: 🍥 Replace tokens in files
uses: cschleiden/replace-tokens@v1
with:
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj", "src/Directory.Build.props", "docs/site/docfx.json"]'
env:
RELEASE_VERSION: ${{ env.NBGV_SimpleVersion }}${{ env.NBGV_PrereleaseVersion }}
RELEASE_VERSION: ${{ steps.nbgv.outputs.SimpleVersion }}${{ steps.nbgv.outputs.PrereleaseVersion }}
RELEASE_NOTES: ${{ steps.changelog_reader.outputs.changes }}

- name: 📄 Build bUnit
Expand Down Expand Up @@ -254,7 +271,7 @@ jobs:
release-preview:
if: github.event_name == 'workflow_dispatch' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/v2')
runs-on: ubuntu-latest
needs: [ validate-nuget, run-test, validate_template, validate-docs ]
needs: [ validate-nuget, run-test, validate-template, validate-docs ]
steps:
- uses: actions/download-artifact@v4
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
- name: ⚙️ Setup GIT versioning
uses: dotnet/[email protected]
id: nbgv
with:
setAllVars: true

Expand All @@ -60,10 +61,10 @@ jobs:
with:
path: ./CHANGELOG.md

- name: 🛠️ Update tokens in project files
- name: 🛠️ Update tokens in files
uses: cschleiden/replace-tokens@v1
with:
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj", "src/Directory.Build.props"]'
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/docfx.json", "*.csproj", "**/*.csproj", "src/Directory.Build.props"]'
env:
RELEASE_VERSION: ${{ steps.changelog_reader.outputs.version }}
RELEASE_NOTES: ${{ steps.changelog_reader.outputs.changes }}
Expand Down Expand Up @@ -123,9 +124,8 @@ jobs:
- name: ⏭ Create pull request from stable to main when direct merge fails
if: steps.mergeMainline.outcome == 'failure'
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.BUNIT_BOT_TOKEN }}
with:
github_token: ${{ secrets.BUNIT_BOT_TOKEN }}
head: stable
base: main
title: Update main with documentation in stable
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ jobs:
version: Unreleased
path: ./CHANGELOG.md

- name: ⚙️ Setup GIT versioning
uses: dotnet/[email protected]
id: nbgv
with:
setAllVars: true

- name: ☑ Check that release contains changes
if: steps.changelog_reader.outputs.changes == ''
run: |
Expand Down Expand Up @@ -85,12 +91,11 @@ jobs:

- name: ⏭ Create pull request for release branch
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.BUNIT_BOT_TOKEN }}
with:
head: release/v${{ env.NBGV_MajorMinorVersion }}
github_token: ${{ secrets.BUNIT_BOT_TOKEN }}
head: release/v${{ steps.nbgv.outputs.MajorMinorVersion }}
base: stable
title: Release of new ${{ github.event.inputs.versionIncrement }} version v${{ env.NBGV_MajorMinorVersion }}
title: Release of new ${{ github.event.inputs.versionIncrement }} version v${{ steps.nbgv.outputs.MajorMinorVersion }}
body: |
This PR was created in response to a manual trigger of the [prepare-release workflow](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/rebase-v2-on-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ jobs:
- name: ⏭ Create pull request
if: steps.rebaseV2.outcome == 'failure'
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.BUNIT_BOT_TOKEN }}
with:
github_token: ${{ secrets.BUNIT_BOT_TOKEN }}
head: main
base: v2
title: Rebase v2 on main
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
- name: ⚙️ Setup GIT versioning
uses: dotnet/[email protected]
id: nbgv
with:
setAllVars: true

Expand All @@ -67,7 +68,7 @@ jobs:
- name: 🛠️ Update changelog
uses: thomaseizinger/[email protected]
with:
version: ${{ env.NBGV_SemVer2 }}
version: ${{ steps.nbgv.outputs.SemVer2 }}

- name: 🛠️ Update changelog compare URLs
shell: bash
Expand All @@ -78,22 +79,22 @@ jobs:
- name: 🛠️ Commit CHANGELOG.md to stable branch
run: |
git add CHANGELOG.md
git commit -S -m "Updated CHANGELOG.md for ${{ env.NBGV_SimpleVersion }} release"
git commit -S -m "Updated CHANGELOG.md for ${{ steps.nbgv.outputs.SimpleVersion }} release"
echo "RELEASE_COMMIT_HASH=$(git rev-parse stable)" >> $GITHUB_ENV
- name: 🛠️ Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ env.NBGV_SemVer2 }}
version: ${{ steps.nbgv.outputs.SemVer2 }}
path: ./CHANGELOG.md

- name: 🛠️ Update tokens in project files
uses: cschleiden/replace-tokens@v1
with:
files: '["docs/site/*.md", "docs/**/*.md", "docs/**/*.tmpl.partial", "*.csproj", "**/*.csproj", "src/Directory.Build.props"]'
env:
RELEASE_VERSION: ${{ env.NBGV_NuGetPackageVersion }}
RELEASE_VERSION: ${{ steps.nbgv.outputs.NuGetPackageVersion }}
RELEASE_NOTES: ${{ steps.changelog_reader.outputs.changes }}

- name: 🛠️ Packing library in release mode
Expand All @@ -111,16 +112,15 @@ jobs:
run: git push origin stable

- name: 🛠️ Create GitHub release
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: thomaseizinger/[email protected]
with:
tag_name: v${{ env.NBGV_SemVer2 }}
tag_name: v${{ steps.nbgv.outputs.SemVer2 }}
target_commitish: ${{ env.RELEASE_COMMIT_HASH }}
name: ${{ env.NBGV_SemVer2 }}
name: ${{ steps.nbgv.outputs.SemVer2 }}
body: ${{ steps.changelog_reader.outputs.changes }}
draft: false
prerelease: ${{ env.NBGV_PublicRelease == 'False' }}
prerelease: ${{ steps.nbgv.outputs.PublicRelease == 'False' }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: ⏩ Merge stable with main, push to origin
id: mergeMainline
Expand All @@ -133,12 +133,11 @@ jobs:
- name: ⏭ Create pull request from stable to main when direct merge fails
if: steps.mergeMainline.outcome == 'failure'
uses: thomaseizinger/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.BUNIT_BOT_TOKEN }}
with:
github_token: ${{ secrets.BUNIT_BOT_TOKEN }}
head: stable
base: main
title: Update main with changes in stable after v${{ env.NBGV_SemVer2 }} release
title: Update main with changes in stable after v${{ steps.nbgv.outputs.SemVer2 }} release
reviewers: ${{ github.actor }} # By default, we request a review from the person who triggered the workflow.
body: |
Hi @${{ github.actor }}
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ All notable changes to **bUnit** will be documented in this file. The project ad

## [Unreleased]

### Fixed

- Ensure that a check in `WaitForAssertion` and related methods is always performed at once before the wait timer is started. If not, the timeout could occure before a wait-for check-condition had been attempted, causing tests to fail without reason. Fixed by [@egil](https://github.com/egil).

## [1.31.3] - 2024-08-16

### Fixed
Expand Down
18 changes: 1 addition & 17 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup Label="Configuration variables">
<DotNet3Version>3.1.*</DotNet3Version>
<DotNet5Version>5.0.*</DotNet5Version>
<DotNet6Version>6.0.*</DotNet6Version>
<DotNet7Version>7.0.*</DotNet7Version>
<DotNet8Version>8.0.*</DotNet8Version>
<DotNet9Version>9.0.0-*</DotNet9Version>
</PropertyGroup>

<!-- Solution wide properties -->
<PropertyGroup Label="Assembly Naming">
<Company>Egil Hansen</Company>
Expand Down Expand Up @@ -49,14 +40,7 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<!-- Shared code analyzers used for all projects in the solution -->
<ItemGroup Label="Code Analyzers">
<PackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Label="Implicit usings"
Condition="$(MSBuildProjectName) != 'bunit.template' AND $(MSBuildProjectName) != 'bunit' AND $(MSBuildProjectName) != 'AngleSharpWrappers.Tests'">
<ItemGroup Label="Implicit usings" Condition="$(MSBuildProjectName) != 'bunit.template' AND $(MSBuildProjectName) != 'bunit' AND $(MSBuildProjectName) != 'bunit.generators'">
<Using Include="Microsoft.AspNetCore.Components" />
<Using Include="Microsoft.AspNetCore.Components.RenderTree" />
<Using Include="Microsoft.AspNetCore.Components.Rendering" />
Expand Down
Loading

0 comments on commit cb3fa8f

Please sign in to comment.