Skip to content

Commit 4701c61

Browse files
author
Thomas Fuchs
committed
Fix and run tests
1 parent 54a407b commit 4701c61

12 files changed

Lines changed: 78 additions & 53 deletions

File tree

.github/workflows/dotnet-release.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@ jobs:
1818
run: dotnet restore
1919
- name: Build Release
2020
run: dotnet build Castle.Windsor.sln -c Release
21-
- name: Castle.Windsor.Tests
22-
run: dotnet test src/Castle.Windsor.Tests
23-
- name: Castle.Windsor.Extensions.DependencyInjection.Tests
24-
run: dotnet test src/Castle.Windsor.Extensions.DependencyInjection.Tests
25-
- name: Castle.Facilities.AspNetCore.Tests
26-
run: dotnet test src/Castle.Facilities.AspNetCore.Tests
21+
- name: Test on .NET 6.0
22+
run: dotnet test -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed"
23+
2724
deploy:
2825
needs: build-ubuntu
2926
runs-on: ubuntu-latest

.github/workflows/dotnet.yml

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,67 @@
11
name: .NET CI
22

33
on:
4-
push:
5-
paths-ignore:
6-
- '**.md'
7-
- '.github/**'
84
pull_request:
95
branches: [ master, main ]
106
paths-ignore:
117
- '**.md'
12-
- '.github/**'
138

149
jobs:
1510
build:
16-
11+
name: Build and test Linux
1712
runs-on: ubuntu-latest
1813

1914
steps:
2015
- uses: actions/checkout@v2
21-
- name: Setup .NET 6.0
22-
uses: actions/setup-dotnet@v1
16+
17+
# Building requires an up-to-date .NET SDK.
18+
- name: Setup dotnet
19+
uses: actions/setup-dotnet@v3
2320
with:
24-
dotnet-version: 6.0.x
21+
dotnet-version: |
22+
6.0.x
23+
7.0.x
24+
25+
# Restore and build
2526
- name: Restore dependencies
26-
run: dotnet restore
27+
run: dotnet restore
2728
- name: Build Nuget Versions
28-
run: dotnet build ./tools/Explicit.NuGet.Versions/Explicit.NuGet.Versions.sln
29+
run: dotnet build ./tools/Explicit.NuGet.Versions/Explicit.NuGet.Versions.sln
2930
- name: Build Release
3031
run: dotnet build Castle.Windsor.sln -c Release
31-
- name: Castle.Windsor.Tests
32-
run: dotnet test src/Castle.Windsor.Tests
33-
- name: Castle.Windsor.Extensions.DependencyInjection.Tests
34-
run: dotnet test src/Castle.Windsor.Extensions.DependencyInjection.Tests
35-
- name: Castle.Facilities.AspNetCore.Tests
36-
run: dotnet test src/Castle.Facilities.AspNetCore.Tests
37-
- name: Castle.Facilities.AspNet.SystemWeb.Tests
38-
run: dotnet test src/Castle.Facilities.AspNet.SystemWeb.Tests
39-
- name: Castle.Facilities.AspNet.Mvc.Tests
40-
run: dotnet test src/Castle.Facilities.AspNet.Mvc.Tests
41-
- name: Castle.Facilities.AspNet.WebApi.Tests
42-
run: dotnet test src/Castle.Facilities.AspNet.WebApi.Tests
43-
- name: Castle.Facilities.WcfIntegration.Tests
44-
run: dotnet test src/Castle.Facilities.WcfIntegration.Tests
32+
33+
# Run tests for linux
34+
- name: Test on .NET 6.0
35+
run: |
36+
dotnet test src/Castle.Windsor.Tests -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed"
37+
dotnet test src/Castle.Windsor.Extensions.DependencyInjection.Tests -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed"
38+
39+
test-windows:
40+
name: Build and test on Windows
41+
runs-on: windows-latest
42+
43+
steps:
44+
- uses: actions/checkout@v2
45+
46+
# Building requires an up-to-date .NET SDK.
47+
- name: Setup dotnet
48+
uses: actions/setup-dotnet@v3
49+
with:
50+
dotnet-version: |
51+
6.0.x
52+
7.0.x
53+
54+
# Restore and build
55+
- name: Restore dependencies
56+
run: dotnet restore
57+
- name: Build Release
58+
run: dotnet build Castle.Windsor.sln -c Release
59+
60+
# Run tests on windows
61+
- name: Test on .NET Framework 4.6.2 (Windows only)
62+
run: |
63+
dotnet test src/Castle.Windsor.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed"
64+
dotnet test src/Castle.Facilities.AspNet.Mvc.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed"
65+
dotnet test src/Castle.Facilities.AspNet.SystemWeb.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed"
66+
dotnet test src/Castle.Facilities.AspNet.WebApi.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed"
67+
dotnet test src/Castle.Facilities.WcfIntegration.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed"

Castle.Windsor.sln

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30711.63
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.7.33913.275
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Castle.Windsor", "src\Castle.Windsor\Castle.Windsor.csproj", "{5F6A631E-8EB1-4BC1-826D-86D3059945B8}"
77
EndProject
@@ -23,6 +23,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Castle Build", "Castle Buil
2323
build.cmd = build.cmd
2424
CHANGELOG.md = CHANGELOG.md
2525
CONTRIBUTING.md = CONTRIBUTING.md
26+
.github\workflows\dotnet-release.yml = .github\workflows\dotnet-release.yml
27+
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
2628
LICENSE = LICENSE
2729
README.md = README.md
2830
EndProjectSection

src/Castle.Facilities.AspNet.Mvc.Tests/Castle.Facilities.AspNet.Mvc.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="11.0.0" />
2020
<PackageReference Include="Microsoft.Web.Infrastructure" Version="1.0.0" />
2121
<PackageReference Include="NUnit" Version="3.13.3" />
22-
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
22+
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
2323
</ItemGroup>
2424

2525
<ItemGroup>

src/Castle.Facilities.AspNet.SystemWeb.Tests/Castle.Facilities.AspNet.SystemWeb.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
2323
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="11.0.0" />
2424
<PackageReference Include="NUnit" Version="3.13.3" />
25-
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
25+
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
2626
</ItemGroup>
2727

2828
<ItemGroup>

src/Castle.Facilities.AspNet.WebApi.Tests/Castle.Facilities.AspNet.WebApi.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="11.0.0" />
2020
<PackageReference Include="Microsoft.Web.Infrastructure" Version="1.0.0" />
2121
<PackageReference Include="NUnit" Version="3.13.3" />
22-
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
22+
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
2323
</ItemGroup>
2424

2525
<ItemGroup>

src/Castle.Facilities.AspNetCore.Tests/Castle.Facilities.AspNetCore.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ItemGroup>
88
<!-- This is an intentional upgrade to NUnit. This is the solution for https://github.com/castleproject/Windsor/issues/243 once we upgrade NUnit and make dotnet test a first class citizen-->
99
<PackageReference Include="NUnit" Version="3.13.3" />
10-
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
10+
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" /> <PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
1111
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
1212
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.1" />
1313
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.2" />

src/Castle.Facilities.AspNetCore/Castle.Facilities.AspNetCore.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
@@ -18,12 +18,12 @@
1818
<RootNamespace>Castle.Facilities.AspNetCore</RootNamespace>
1919
</PropertyGroup>
2020

21-
<ItemGroup>
22-
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.1" />
23-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.2" />
24-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor" Version="2.0.2" />
25-
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" />
26-
</ItemGroup>
21+
<ItemGroup>
22+
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.1" />
23+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.2" />
24+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor" Version="2.0.2" />
25+
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" />
26+
</ItemGroup>
2727

2828
<ItemGroup>
2929
<ProjectReference Include="..\Castle.Windsor\Castle.Windsor.csproj" />

src/Castle.Facilities.WcfIntegration.Tests/Castle.Facilities.WcfIntegration.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<ItemGroup>
1515
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
1616
<PackageReference Include="NUnit" Version="3.13.3" />
17-
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
17+
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net462;netcoreapp3.1;net6.0</TargetFrameworks>
4+
<TargetFrameworks>net462;netcoreapp3.1;net6.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<Import Project="..\..\buildscripts\common.props"></Import>
@@ -47,7 +47,8 @@
4747
<PackageReference Include="Castle.Core-log4net" Version="[5.1.0,6.0)" />
4848
<PackageReference Include="Castle.Core-NLog" Version="[5.1.0,6.0)" />
4949
<PackageReference Include="NUnit" Version="3.13.3" />
50-
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
50+
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
51+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
5152
</ItemGroup>
5253

5354
<ItemGroup Condition="'$(TargetFramework)'=='net462'">
@@ -67,8 +68,8 @@
6768
<Reference Include="System.Xaml" />
6869
<Reference Include="WindowsBase" />
6970
</ItemGroup>
70-
71-
<PropertyGroup Condition="'$(TargetFramework)'=='net462'">
71+
72+
<PropertyGroup Condition="'$(TargetFramework)'=='net462'">
7273
<DefineConstants>$(DefineConstants);FEATURE_THREADABORT;FEATURE_WPF;FEATURE_CONSOLETRACELISTENER</DefineConstants>
7374
</PropertyGroup>
7475

0 commit comments

Comments
 (0)