Skip to content

Commit

Permalink
feat: dotnet7 support including nightly verification against nightly …
Browse files Browse the repository at this point in the history
…version
  • Loading branch information
linkdotnet authored and egil committed Apr 6, 2022
1 parent dc02a02 commit f69091e
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 17 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/verification-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: verification against nightly aspnet core builds

on:
push:
branches:
- 'feature/*'
schedule:
- cron: "0 0 * * *"

jobs:
verify-bunit:
name: 👌 Verify bUnit
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/dotnet/nightly/sdk:7.0

steps:
- name: 🌛 Show dotnet version
run: |
dotnet --info
- name: 🛒 Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: 🧪 Run unit tests
run: |
dotnet test ./tests/bunit.core.tests/bunit.core.tests.csproj -c release --logger GitHubActions --blame-hang --blame-hang-timeout 1m --blame-hang-dump-type none
dotnet test ./tests/bunit.web.tests/bunit.web.tests.csproj -c release --logger GitHubActions --blame-hang --blame-hang-timeout 1m --blame-hang-dump-type none
dotnet test ./tests/bunit.web.testcomponents.tests/bunit.web.testcomponents.tests.csproj -c release --logger GitHubActions --blame-hang --blame-hang-timeout 1m --blame-hang-dump-type none
2 changes: 0 additions & 2 deletions .github/workflows/verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: verification

on:
push:
branches:
- main
paths:
- 'src/**'
- 'tests/**'
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<DotNet3Version>3.1.22</DotNet3Version>
<DotNet5Version>5.0.0</DotNet5Version>
<DotNet6Version>6.0.0</DotNet6Version>
<DotNet7Version>7.0.0</DotNet7Version>
</PropertyGroup>

<!-- Solution wide properties -->
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"rollForward": "latestMajor",
"allowPrerelease": false
"allowPrerelease": true
}
}
10 changes: 8 additions & 2 deletions src/bunit.core/bunit.core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<RootNamespace>Bunit</RootNamespace>
<AssemblyName>Bunit.Core</AssemblyName>
</PropertyGroup>
Expand Down Expand Up @@ -36,4 +36,10 @@
<PackageReference Include="Microsoft.AspNetCore.Components" Version="$(DotNet6Version)" />
</ItemGroup>

</Project>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0-preview.2.22152.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0-preview.2.22152.2" />
<PackageReference Include="Microsoft.AspNetCore.Components" Version="7.0.0-preview.2.22153.2" />
</ItemGroup>

</Project>
14 changes: 12 additions & 2 deletions src/bunit.web.testcomponents/bunit.web.testcomponents.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net5.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<RootNamespace>Bunit</RootNamespace>
<AssemblyName>Bunit.Web.TestComponents</AssemblyName>
</PropertyGroup>
Expand Down Expand Up @@ -37,8 +37,18 @@ NOTE: This package represents experimental features of bUnit that has been super
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(DotNet5Version)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="$(DotNet6Version)" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(DotNet6Version)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Components" Version="7.0.0-preview.2.22153.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.0-preview.2.22153.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\bunit.web\bunit.web.csproj" />
</ItemGroup>

</Project>
</Project>
11 changes: 9 additions & 2 deletions src/bunit.web/bunit.web.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<RootNamespace>Bunit</RootNamespace>
<AssemblyName>Bunit.Web</AssemblyName>
</PropertyGroup>
Expand Down Expand Up @@ -43,6 +43,13 @@
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="$(DotNet6Version)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="7.0.0-preview.2.22153.2" />
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.0-preview.2.22153.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.0-preview.2.22153.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="7.0.0-preview.2.22153.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\bunit.core\bunit.core.csproj" />
</ItemGroup>
Expand All @@ -52,4 +59,4 @@
<Using Include="Microsoft.JSInterop" />
</ItemGroup>

</Project>
</Project>
2 changes: 1 addition & 1 deletion src/bunit/bunit.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<NoBuild>true</NoBuild>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IncludeSymbols>false</IncludeSymbols>
Expand Down
4 changes: 2 additions & 2 deletions tests/bunit.core.tests/bunit.core.tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<RootNamespace>Bunit</RootNamespace>
<AssemblyName>Bunit.Core.Tests</AssemblyName>
</PropertyGroup>
Expand All @@ -12,4 +12,4 @@
<ProjectReference Include="..\bunit.testassets\bunit.testassets.csproj" />
</ItemGroup>

</Project>
</Project>
8 changes: 6 additions & 2 deletions tests/bunit.testassets/bunit.testassets.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net5.0;net6.0;net7.0</TargetFrameworks>
<RootNamespace>Bunit.TestAssets</RootNamespace>
<AssemblyName>Bunit.TestAssets</AssemblyName>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
Expand All @@ -28,6 +28,10 @@
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="$(DotNet6Version)" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="$(DotNet6Version)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.Localization.Abstractions" Version="7.0.0-preview.2.22153.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="7.0.0-preview.2.22153.2" />
</ItemGroup>

<!-- https://github.com/dotnet/sdk/issues/18148#issuecomment-860957180 from @elion -->
<!-- Workaround for this bug (replace the analyzer name with the one you need to exclude (filename only, no extension) -->
Expand All @@ -36,4 +40,4 @@
<Analyzer Remove="@(Analyzer)" Condition="%(FileName) == 'Microsoft.Extensions.Logging.Generators'" />
</ItemGroup>
</Target>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
<ProjectReference Include="..\bunit.testassets\bunit.testassets.csproj" />
</ItemGroup>

</Project>
</Project>
4 changes: 2 additions & 2 deletions tests/bunit.web.tests/bunit.web.tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0;net7.0</TargetFrameworks>
<RootNamespace>Bunit</RootNamespace>
<AssemblyName>Bunit.Web.Tests</AssemblyName>
</PropertyGroup>
Expand All @@ -12,4 +12,4 @@
<ProjectReference Include="..\bunit.testassets\bunit.testassets.csproj" />
</ItemGroup>

</Project>
</Project>

0 comments on commit f69091e

Please sign in to comment.