Skip to content

Commit d9bf80e

Browse files
committed
Update to dependencies, updates to template
1 parent e5a4cfa commit d9bf80e

18 files changed

Lines changed: 228 additions & 114 deletions

File tree

.github/workflows/CI.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@ on:
99
env:
1010
VERSION: 1337.0.0
1111
BRANCH: ''
12-
COMMIT: ''
1312

1413
jobs:
1514
build:
1615
name: Build and verify library
1716
runs-on: ubuntu-latest
1817
steps:
19-
- name: Setting environment variables
20-
run: |
21-
echo "::set-env name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
22-
echo "::set-env name=COMMIT::$GITHUB_SHA"
23-
- run: echo Version $VERSION - Branch $BRANCH - Commit $COMMIT
18+
- name: Getting branch name
19+
run: echo "::set-env name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
2420
- uses: actions/checkout@v2
2521
- name: Update tokens in project files
2622
uses: cschleiden/replace-tokens@v1
@@ -32,19 +28,19 @@ jobs:
3228
- name: Building and verifying library
3329
run: |
3430
dotnet restore src
35-
dotnet build src -c Release --no-restore
31+
dotnet build src -c Release --no-restore -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
3632
dotnet test src -c Release --no-restore --verbosity normal /nowarn:CS1591
3733
- name: Creating library package
3834
run: |
39-
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION /nowarn:CS1591
40-
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION /nowarn:CS1591
41-
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION /nowarn:CS1591
42-
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION /nowarn:CS1591
43-
# - name: Buidling template package
44-
# run: dotnet pack templates/bunit-project/ -c Release -o ${GITHUB_WORKSPACE}/templates -p:version=$VERSION -p:PackageVersion=$VERSION
45-
# - name: Verifying template
46-
# run: |
47-
# dotnet new --install ${GITHUB_WORKSPACE}/templates/bunit.template.$VERSION.nupkg
48-
# dotnet new bunit -o ${GITHUB_WORKSPACE}/Test
49-
# dotnet restore ${GITHUB_WORKSPACE}/Test/Test.csproj --source ${GITHUB_WORKSPACE}/lib
50-
# dotnet test ${GITHUB_WORKSPACE}/Test
35+
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
36+
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
37+
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
38+
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
39+
- name: Buidling template package
40+
run: dotnet pack templates/bunit-project/ -c Release -o ${GITHUB_WORKSPACE}/templates -p:version=$VERSION
41+
- name: Verifying template
42+
run: |
43+
dotnet new --install ${GITHUB_WORKSPACE}/templates/bunit.template.$VERSION.nupkg
44+
dotnet new bunit --no-restore -o ${GITHUB_WORKSPACE}/Test
45+
dotnet restore ${GITHUB_WORKSPACE}/Test/Test.csproj --source ${GITHUB_WORKSPACE}/lib
46+
dotnet test ${GITHUB_WORKSPACE}/Test

.github/workflows/nuget-pack-push.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@ on:
88

99
env:
1010
VERSION: 0.0.0
11-
BRANCH: "master"
12-
COMMIT: ""
11+
BRANCH: ''
1312

1413
jobs:
1514
build:
1615
name: Build and verify library
1716
runs-on: ubuntu-latest
1817
steps:
19-
- name: Setting environment variables
18+
- name: Getting branch name and release version
2019
run: |
21-
#echo "::set-env name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
22-
echo "::set-env name=COMMIT::$GITHUB_SHA"
20+
echo "::set-env name=BRANCH::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
2321
echo "::set-env name=VERSION::${GITHUB_REF/refs\/tags\/v/}"
2422
- run: echo Version $VERSION - Branch $BRANCH - Commit $COMMIT
2523
- uses: actions/checkout@v1
@@ -32,20 +30,21 @@ jobs:
3230
dotnet-version: '3.1.201'
3331
- name: Building and verifying library
3432
run: |
35-
dotnet build src -c Release /nowarn:CS1591
36-
dotnet test src -c Release /nowarn:CS1591
33+
dotnet restore src
34+
dotnet build src -c Release --no-restore -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
35+
dotnet test src -c Release --no-restore --verbosity normal /nowarn:CS1591
3736
- name: Creating library package
3837
run: |
39-
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION /nowarn:CS1591
40-
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION /nowarn:CS1591
41-
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION /nowarn:CS1591
42-
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION /nowarn:CS1591
38+
dotnet pack src/bunit.core/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
39+
dotnet pack src/bunit.web/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
40+
dotnet pack src/bunit.xunit/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
41+
dotnet pack src/bunit/ -c Release -o ${GITHUB_WORKSPACE}/lib -p:version=$VERSION -p:RepositoryBranch=$BRANCH -p:ContinuousIntegrationBuild=true -p:DeterministicSourcePaths=true
4342
- name: Buidling template package
44-
run: dotnet pack template/ -c Release -o ${GITHUB_WORKSPACE}/template -p:version=$VERSION -p:PackageVersion=$VERSION
43+
run: dotnet pack templates/bunit-project/ -c Release -o ${GITHUB_WORKSPACE}/templates -p:version=$VERSION
4544
- name: Verifying template
4645
run: |
47-
dotnet new --install ${GITHUB_WORKSPACE}/template/bunit.template.$VERSION.nupkg
48-
dotnet new bunit -o ${GITHUB_WORKSPACE}/Test
46+
dotnet new --install ${GITHUB_WORKSPACE}/templates/bunit.template.$VERSION.nupkg
47+
dotnet new bunit --no-restore -o ${GITHUB_WORKSPACE}/Test
4948
dotnet restore ${GITHUB_WORKSPACE}/Test/Test.csproj --source ${GITHUB_WORKSPACE}/lib
5049
dotnet test ${GITHUB_WORKSPACE}/Test
5150
- name: Push packages to NuGet.org

src/bunit.core.tests/bunit.core.tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.3" />
12-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.3" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.4" />
12+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.4" />
1313
<PackageReference Include="AngleSharp" Version="0.14.0" />
1414
<PackageReference Include="AngleSharp.Css" Version="0.14.0" />
1515
<PackageReference Include="AngleSharp.Diffing" Version="0.14.0" />

src/bunit.core/bunit.core.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1919
<RepositoryUrl>https://github.com/egil/bunit</RepositoryUrl>
2020
<RepositoryType>git</RepositoryType>
21-
<RepositoryBranch>#{BRANCH}#</RepositoryBranch>
22-
<RepositoryCommit>#{COMMIT}#</RepositoryCommit>
2321
<PackageProjectUrl>https://bunit.egilhansen.com</PackageProjectUrl>
2422
<PackageTags>bUnit;razor components;blazor components;unit testing;testing blazor components;blazor server;blazor wasm</PackageTags>
2523
<Authors>Egil Hansen</Authors>
@@ -32,6 +30,7 @@
3230
<EmbedUntrackedSources>true</EmbedUntrackedSources>
3331
<IncludeSymbols>true</IncludeSymbols>
3432
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
33+
<Deterministic>true</Deterministic>
3534
</PropertyGroup>
3635

3736
<ItemGroup>

src/bunit.sln

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{785D
4444
..\.github\workflows\nuget-pack-push.yml = ..\.github\workflows\nuget-pack-push.yml
4545
EndProjectSection
4646
EndProject
47+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "bunit.template", "..\templates\bunit-project\bunit.template.csproj", "{67937C33-0609-4B37-AA36-5441B701C74B}"
48+
EndProject
4749
Global
4850
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4951
Debug|Any CPU = Debug|Any CPU
@@ -84,6 +86,8 @@ Global
8486
{797E5586-8F42-4EC6-A70A-F99BAC747AE7}.Release|Any CPU.Build.0 = Release|Any CPU
8587
{2C0FEE71-208C-4CAD-B37B-C762D9D30A3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
8688
{2C0FEE71-208C-4CAD-B37B-C762D9D30A3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
89+
{67937C33-0609-4B37-AA36-5441B701C74B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
90+
{67937C33-0609-4B37-AA36-5441B701C74B}.Release|Any CPU.ActiveCfg = Release|Any CPU
8791
EndGlobalSection
8892
GlobalSection(SolutionProperties) = preSolution
8993
HideSolutionNode = FALSE

src/bunit.web.tests/bunit.web.tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.3" />
12-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.3" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.4" />
12+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.4" />
1313
<PackageReference Include="AngleSharp" Version="0.14.0" />
1414
<PackageReference Include="AngleSharp.Css" Version="0.14.0" />
1515
<PackageReference Include="AngleSharp.Diffing" Version="0.14.0" />

src/bunit.web/bunit.web.csproj

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@
88
<AssemblyName>Bunit.Web</AssemblyName>
99
</PropertyGroup>
1010

11-
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
12-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
13-
</PropertyGroup>
11+
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
12+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
13+
</PropertyGroup>
1414

1515
<PropertyGroup>
1616
<PackageId>bunit.web</PackageId>
1717
<Title>bUnit.core</Title>
1818
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1919
<RepositoryUrl>https://github.com/egil/bunit.git</RepositoryUrl>
2020
<RepositoryType>git</RepositoryType>
21-
<RepositoryBranch>#{BRANCH}#</RepositoryBranch>
22-
<RepositoryCommit>#{COMMIT}#</RepositoryCommit>
2321
<PackageProjectUrl>https://bunit.egilhansen.com</PackageProjectUrl>
2422
<PackageTags>bUnit;razor components;blazor components;unit testing;testing blazor components;blazor server;blazor wasm</PackageTags>
2523
<Authors>Egil Hansen</Authors>
@@ -30,12 +28,13 @@
3028

3129
You can easily define components under test in C# or Razor syntax and verify outcome using semantic HTML diffing/comparison logic. You can interact with and inspect the component under test, trigger event handlers, provide cascading values, inject services, mock JavaScript interopt, and perform snapshot testing.
3230
</Description>
33-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
34-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
35-
<IncludeSymbols>true</IncludeSymbols>
36-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
31+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
32+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
33+
<IncludeSymbols>true</IncludeSymbols>
34+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
35+
<Deterministic>true</Deterministic>
3736
</PropertyGroup>
38-
37+
3938
<ItemGroup>
4039
<PackageReference Include="AngleSharp" Version="0.14.0" />
4140
<PackageReference Include="AngleSharp.Css" Version="0.14.0" />
@@ -49,7 +48,7 @@
4948
</ItemGroup>
5049

5150
<ItemGroup>
52-
<ProjectReference Include="..\bunit.core\bunit.core.csproj" />
51+
<ProjectReference Include="..\bunit.core\bunit.core.csproj" />
5352
</ItemGroup>
5453

5554
</Project>

src/bunit.xunit.tests/bunit.xunit.tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.3" />
12-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.3" />
13-
<PackageReference Include="System.Reflection.Metadata" Version="1.8.0" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components" Version="3.1.4" />
12+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="3.1.4" />
13+
<PackageReference Include="System.Reflection.Metadata" Version="1.8.1" />
1414
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
1515
<PackageReference Include="Moq" Version="4.14.1" />
1616
<PackageReference Include="Shouldly" Version="4.0.0-beta0002" />

src/bunit.xunit/bunit.xunit.csproj

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,16 @@
77
<AssemblyName>Bunit.Xunit</AssemblyName>
88
</PropertyGroup>
99

10-
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
11-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
12-
</PropertyGroup>
10+
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
11+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
12+
</PropertyGroup>
1313

1414
<PropertyGroup>
1515
<PackageId>bunit.xunit</PackageId>
1616
<Title>bUnit.xunit</Title>
1717
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1818
<RepositoryUrl>https://github.com/egil/bunit.git</RepositoryUrl>
1919
<RepositoryType>git</RepositoryType>
20-
<RepositoryBranch>#{BRANCH}#</RepositoryBranch>
21-
<RepositoryCommit>#{COMMIT}#</RepositoryCommit>
2220
<PackageProjectUrl>https://bunit.egilhansen.com</PackageProjectUrl>
2321
<PackageTags>bUnit;razor components;blazor components;unit testing;testing blazor components;blazor server;blazor wasm</PackageTags>
2422
<Authors>Egil Hansen</Authors>
@@ -27,10 +25,11 @@
2725
<Description>
2826
bUnit.xunit is an xUnit extension for bUnit, that provides a way for xUnit to run bUnit's razor-based tests, as well as other helpful extensions to make the testing experience better if you use xUnit for writing your tests.
2927
</Description>
30-
<PublishRepositoryUrl>true</PublishRepositoryUrl>
31-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
32-
<IncludeSymbols>true</IncludeSymbols>
33-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
28+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
29+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
30+
<IncludeSymbols>true</IncludeSymbols>
31+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
32+
<Deterministic>true</Deterministic>
3433
</PropertyGroup>
3534

3635
<ItemGroup>
@@ -42,11 +41,10 @@
4241
<PackageReference Include="xunit.assert" Version="2.4.*" />
4342
<PackageReference Include="xunit.extensibility.core" Version="2.4.*" />
4443
<PackageReference Include="xunit.extensibility.execution" Version="2.4.*" />
45-
4644
</ItemGroup>
4745

4846
<ItemGroup>
4947
<ProjectReference Include="..\bunit.core\bunit.core.csproj" />
5048
</ItemGroup>
51-
49+
5250
</Project>

templates/bunit-project/bunit.template.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
<PackageDescription>
1313
A project template for a testing Blazor/Razor components using the bUnit library.
1414

15-
bUnit is a unit testing library for Blazor Components. You can easily define components under test in C# or Razor syntax and verify outcome using semantic HTML diffing/comparison logic. You can easily interact with and inspect components, trigger event handlers, provide cascading values, inject services, mock IJsRuntime, and perform snapshot testing.
15+
bUnit is a testing library for Blazor Components. You can easily define components under test in C# or Razor syntax and verify outcome using semantic HTML diffing/comparison logic. You can easily interact with and inspect components, trigger event handlers, provide cascading values, inject services, mock IJsRuntime, and perform snapshot testing.
1616

17-
This library's goal is to make it easy to write comprehensive, stable unit tests for Blazor Components/Razor Components. Head to https://bunit.egilhansen.com to learn more.
17+
The library's goal is to make it easy to write comprehensive, stable unit tests for Blazor Components/Razor Components. Go to bunit.egilhansen.com to learn more.
1818
</PackageDescription>
19-
<PackageTags>blazor component testing;blazor test;component test;unit test;integration test;</PackageTags>
19+
<PackageTags>bUnit;razor components;blazor components;unit testing;testing blazor components;blazor server;blazor wasm</PackageTags>
2020
<PackageProjectUrl>https://github.com/egil/bunit</PackageProjectUrl>
2121
<TargetFramework>netstandard2.1</TargetFramework>
2222
<IncludeContentInPack>true</IncludeContentInPack>

0 commit comments

Comments
 (0)