From 14c184400455221b0d9ee8ac38fa6cd27a18be4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Schultz=20Madsen?= Date: Wed, 30 Nov 2022 06:48:06 +0000 Subject: [PATCH 1/8] Adding Github Actions build script for easy testing. --- .github/workflows/dotnet-ubuntu-pr.yml | 40 ++++++++++++++++++++++++++ .github/workflows/dotnet-ubuntu.yml | 40 ++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 .github/workflows/dotnet-ubuntu-pr.yml create mode 100644 .github/workflows/dotnet-ubuntu.yml diff --git a/.github/workflows/dotnet-ubuntu-pr.yml b/.github/workflows/dotnet-ubuntu-pr.yml new file mode 100644 index 000000000..67e421444 --- /dev/null +++ b/.github/workflows/dotnet-ubuntu-pr.yml @@ -0,0 +1,40 @@ +name: .NET Ubuntu PR + +on: + pull_request: + branches: [ master, main ] + paths-ignore: + - '**.md' + - '.github/**' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET 6.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build Nuget Versions + run: dotnet build ./tools/Explicit.NuGet.Versions/Explicit.NuGet.Versions.sln + - name: Build Release + run: dotnet build Castle.Windsor.sln -c Release + - name: Castle.Windsor.Tests + run: dotnet test src/Castle.Windsor.Tests + - name: Castle.Windsor.Extensions.DependencyInjection.Tests + run: dotnet test src/Castle.Windsor.Extensions.DependencyInjection.Tests + - name: Castle.Facilities.AspNetCore.Tests + run: dotnet test src/Castle.Facilities.AspNetCore.Tests + - name: Castle.Facilities.AspNet.SystemWeb.Tests + run: dotnet test src/Castle.Facilities.AspNet.SystemWeb.Tests + - name: Castle.Facilities.AspNet.Mvc.Tests + run: dotnet test src/Castle.Facilities.AspNet.Mvc.Tests + - name: Castle.Facilities.AspNet.WebApi.Tests + run: dotnet test src/Castle.Facilities.AspNet.WebApi.Tests + - name: Castle.Facilities.WcfIntegration.Tests + run: dotnet test src/Castle.Facilities.WcfIntegration.Tests diff --git a/.github/workflows/dotnet-ubuntu.yml b/.github/workflows/dotnet-ubuntu.yml new file mode 100644 index 000000000..3ba164092 --- /dev/null +++ b/.github/workflows/dotnet-ubuntu.yml @@ -0,0 +1,40 @@ +name: .NET Ubuntu + +on: + push: + branches: [ master, main ] + paths-ignore: + - '**.md' + - '.github/**' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET 6.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build Nuget Versions + run: dotnet build ./tools/Explicit.NuGet.Versions/Explicit.NuGet.Versions.sln + - name: Build Release + run: dotnet build Castle.Windsor.sln -c Release + - name: Castle.Windsor.Tests + run: dotnet test src/Castle.Windsor.Tests + - name: Castle.Windsor.Extensions.DependencyInjection.Tests + run: dotnet test src/Castle.Windsor.Extensions.DependencyInjection.Tests + - name: Castle.Facilities.AspNetCore.Tests + run: dotnet test src/Castle.Facilities.AspNetCore.Tests + - name: Castle.Facilities.AspNet.SystemWeb.Tests + run: dotnet test src/Castle.Facilities.AspNet.SystemWeb.Tests + - name: Castle.Facilities.AspNet.Mvc.Tests + run: dotnet test src/Castle.Facilities.AspNet.Mvc.Tests + - name: Castle.Facilities.AspNet.WebApi.Tests + run: dotnet test src/Castle.Facilities.AspNet.WebApi.Tests + - name: Castle.Facilities.WcfIntegration.Tests + run: dotnet test src/Castle.Facilities.WcfIntegration.Tests From e5d1c513540d43c95a963f1b5a15a92201cf7f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Schultz=20Madsen?= Date: Wed, 30 Nov 2022 09:07:09 +0000 Subject: [PATCH 2/8] Changing PackageId so we can release a new Nuget under Microting namespace. Adding release script. --- .github/workflows/dotnet-release.yml | 46 +++++++++++++++++++ .../Castle.Facilities.AspNetCore.csproj | 2 +- .../Castle.Facilities.Logging.csproj | 2 +- ...dsor.Extensions.DependencyInjection.csproj | 2 +- .../Castle.Windsor.Extensions.Hosting.csproj | 2 +- src/Castle.Windsor/Castle.Windsor.csproj | 2 +- 6 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/dotnet-release.yml diff --git a/.github/workflows/dotnet-release.yml b/.github/workflows/dotnet-release.yml new file mode 100644 index 000000000..9351797e4 --- /dev/null +++ b/.github/workflows/dotnet-release.yml @@ -0,0 +1,46 @@ +name: .NET Release + +on: + push: + tags: + - 'v*.*.*' + +jobs: + build-ubuntu: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup .NET 7.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 7.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build Release + run: dotnet build Castle.Windsor.sln -c Release + - name: Castle.Windsor.Tests + run: dotnet test src/Castle.Windsor.Tests + - name: Castle.Windsor.Extensions.DependencyInjection.Tests + run: dotnet test src/Castle.Windsor.Extensions.DependencyInjection.Tests + - name: Castle.Facilities.AspNetCore.Tests + run: dotnet test src/Castle.Facilities.AspNetCore.Tests + deploy: + needs: build-ubuntu + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 7.0.x + - name: Restore dependencies + run: dotnet restore + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | cut -d "v" -f 2) + - name: Build + run: dotnet build Castle.Windsor.sln --configuration Release + - name: Pack + run: dotnet pack Castle.Windsor.sln -c Release -o ./artifacts -p:PackageVersion=${{ steps.get_version.outputs.VERSION }} + - name: Push generated Rebus package to GitHub registry + run: dotnet nuget push /home/runner/work/Windsor/Windsor/artifacts/Microting.Castle.Windsor.${{ steps.get_version.outputs.VERSION }}.nupkg -k ${{secrets.NUGET_SECRET_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols \ No newline at end of file diff --git a/src/Castle.Facilities.AspNetCore/Castle.Facilities.AspNetCore.csproj b/src/Castle.Facilities.AspNetCore/Castle.Facilities.AspNetCore.csproj index 69d652dbd..2060f59de 100644 --- a/src/Castle.Facilities.AspNetCore/Castle.Facilities.AspNetCore.csproj +++ b/src/Castle.Facilities.AspNetCore/Castle.Facilities.AspNetCore.csproj @@ -8,7 +8,7 @@ true - Castle.Facilities.AspNetCore + Microting.Castle.Facilities.AspNetCore Castle Windsor ASP.NET Core facility Castle Windsor ASP.NET Core facility lets you easily add windsor to aspnet core apps. castle, windsor, inversionOfControl, DependencyInjection, aspnet, core diff --git a/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj b/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj index ba41b5204..c44fa6f6c 100644 --- a/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj +++ b/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj @@ -8,7 +8,7 @@ true - Castle.LoggingFacility + Microting.Castle.LoggingFacility Castle Windsor logging facility Castle Windsor logging facility lets you easily inject loggers into your components. It offers integration with most popular 3rd party logging frameworks like log4net, NLog and Serilog (see Castle Core docs). castle, windsor, inversionOfControl, DependencyInjection, logging, log4net, nlog diff --git a/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj b/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj index 39e554100..f5fee6240 100644 --- a/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj +++ b/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj @@ -9,7 +9,7 @@ true - Castle.Windsor.Extensions.DependencyInjection + Microting.Castle.Windsor.Extensions.DependencyInjection Castle Windsor extension for .NET Extensions DependencyInjection Allows to use Castle Windsor as a container using IServiceProvider castle, windsor, inversionOfControl, DependencyInjection, aspnet, core diff --git a/src/Castle.Windsor.Extensions.Hosting/Castle.Windsor.Extensions.Hosting.csproj b/src/Castle.Windsor.Extensions.Hosting/Castle.Windsor.Extensions.Hosting.csproj index 88fb0f84d..2974da7ef 100644 --- a/src/Castle.Windsor.Extensions.Hosting/Castle.Windsor.Extensions.Hosting.csproj +++ b/src/Castle.Windsor.Extensions.Hosting/Castle.Windsor.Extensions.Hosting.csproj @@ -9,7 +9,7 @@ true - Castle.Windsor.Extensions.Hosting + Microting.Castle.Windsor.Extensions.Hosting Castle Windsor extension for .NET Extensions Hosting Allows to use Castle Windsor as a container using IServiceProvider castle, windsor, inversionOfControl, DependencyInjection, aspnet, core diff --git a/src/Castle.Windsor/Castle.Windsor.csproj b/src/Castle.Windsor/Castle.Windsor.csproj index f5acdcc0b..661805cc0 100644 --- a/src/Castle.Windsor/Castle.Windsor.csproj +++ b/src/Castle.Windsor/Castle.Windsor.csproj @@ -8,7 +8,7 @@ true - Castle.Windsor + Microting.Castle.Windsor Castle Windsor Castle Windsor is best of breed, mature Inversion of Control container available for .NET. castle, windsor, inversionOfControl, DependencyInjection From 66643afbbd39fffb328b75dc7e119382ec283e93 Mon Sep 17 00:00:00 2001 From: Thomas Fuchs Date: Thu, 20 Jul 2023 12:26:40 +0200 Subject: [PATCH 3/8] Revert package id changes --- .github/workflows/dotnet-release.yml | 2 +- .../Castle.Facilities.AspNetCore.csproj | 2 +- src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj | 2 +- .../Castle.Windsor.Extensions.DependencyInjection.csproj | 2 +- .../Castle.Windsor.Extensions.Hosting.csproj | 2 +- src/Castle.Windsor/Castle.Windsor.csproj | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dotnet-release.yml b/.github/workflows/dotnet-release.yml index 9351797e4..3234b47ff 100644 --- a/.github/workflows/dotnet-release.yml +++ b/.github/workflows/dotnet-release.yml @@ -43,4 +43,4 @@ jobs: - name: Pack run: dotnet pack Castle.Windsor.sln -c Release -o ./artifacts -p:PackageVersion=${{ steps.get_version.outputs.VERSION }} - name: Push generated Rebus package to GitHub registry - run: dotnet nuget push /home/runner/work/Windsor/Windsor/artifacts/Microting.Castle.Windsor.${{ steps.get_version.outputs.VERSION }}.nupkg -k ${{secrets.NUGET_SECRET_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols \ No newline at end of file + run: dotnet nuget push /home/runner/work/Windsor/Windsor/artifacts/Castle.Windsor.${{ steps.get_version.outputs.VERSION }}.nupkg -k ${{secrets.NUGET_SECRET_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols \ No newline at end of file diff --git a/src/Castle.Facilities.AspNetCore/Castle.Facilities.AspNetCore.csproj b/src/Castle.Facilities.AspNetCore/Castle.Facilities.AspNetCore.csproj index 2060f59de..69d652dbd 100644 --- a/src/Castle.Facilities.AspNetCore/Castle.Facilities.AspNetCore.csproj +++ b/src/Castle.Facilities.AspNetCore/Castle.Facilities.AspNetCore.csproj @@ -8,7 +8,7 @@ true - Microting.Castle.Facilities.AspNetCore + Castle.Facilities.AspNetCore Castle Windsor ASP.NET Core facility Castle Windsor ASP.NET Core facility lets you easily add windsor to aspnet core apps. castle, windsor, inversionOfControl, DependencyInjection, aspnet, core diff --git a/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj b/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj index c44fa6f6c..ba41b5204 100644 --- a/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj +++ b/src/Castle.Facilities.Logging/Castle.Facilities.Logging.csproj @@ -8,7 +8,7 @@ true - Microting.Castle.LoggingFacility + Castle.LoggingFacility Castle Windsor logging facility Castle Windsor logging facility lets you easily inject loggers into your components. It offers integration with most popular 3rd party logging frameworks like log4net, NLog and Serilog (see Castle Core docs). castle, windsor, inversionOfControl, DependencyInjection, logging, log4net, nlog diff --git a/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj b/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj index f5fee6240..39e554100 100644 --- a/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj +++ b/src/Castle.Windsor.Extensions.DependencyInjection/Castle.Windsor.Extensions.DependencyInjection.csproj @@ -9,7 +9,7 @@ true - Microting.Castle.Windsor.Extensions.DependencyInjection + Castle.Windsor.Extensions.DependencyInjection Castle Windsor extension for .NET Extensions DependencyInjection Allows to use Castle Windsor as a container using IServiceProvider castle, windsor, inversionOfControl, DependencyInjection, aspnet, core diff --git a/src/Castle.Windsor.Extensions.Hosting/Castle.Windsor.Extensions.Hosting.csproj b/src/Castle.Windsor.Extensions.Hosting/Castle.Windsor.Extensions.Hosting.csproj index 2974da7ef..88fb0f84d 100644 --- a/src/Castle.Windsor.Extensions.Hosting/Castle.Windsor.Extensions.Hosting.csproj +++ b/src/Castle.Windsor.Extensions.Hosting/Castle.Windsor.Extensions.Hosting.csproj @@ -9,7 +9,7 @@ true - Microting.Castle.Windsor.Extensions.Hosting + Castle.Windsor.Extensions.Hosting Castle Windsor extension for .NET Extensions Hosting Allows to use Castle Windsor as a container using IServiceProvider castle, windsor, inversionOfControl, DependencyInjection, aspnet, core diff --git a/src/Castle.Windsor/Castle.Windsor.csproj b/src/Castle.Windsor/Castle.Windsor.csproj index 661805cc0..f5acdcc0b 100644 --- a/src/Castle.Windsor/Castle.Windsor.csproj +++ b/src/Castle.Windsor/Castle.Windsor.csproj @@ -8,7 +8,7 @@ true - Microting.Castle.Windsor + Castle.Windsor Castle Windsor Castle Windsor is best of breed, mature Inversion of Control container available for .NET. castle, windsor, inversionOfControl, DependencyInjection From 4a027ee6b297b099ef3f12a85484eef8e20e7e61 Mon Sep 17 00:00:00 2001 From: Thomas Fuchs Date: Thu, 20 Jul 2023 12:29:36 +0200 Subject: [PATCH 4/8] Apply action renaming --- .github/workflows/dotnet-ubuntu.yml | 40 ------------------- .../{dotnet-ubuntu-pr.yml => dotnet.yml} | 6 ++- 2 files changed, 5 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/dotnet-ubuntu.yml rename .github/workflows/{dotnet-ubuntu-pr.yml => dotnet.yml} (94%) diff --git a/.github/workflows/dotnet-ubuntu.yml b/.github/workflows/dotnet-ubuntu.yml deleted file mode 100644 index 3ba164092..000000000 --- a/.github/workflows/dotnet-ubuntu.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: .NET Ubuntu - -on: - push: - branches: [ master, main ] - paths-ignore: - - '**.md' - - '.github/**' - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Setup .NET 6.0 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.x - - name: Restore dependencies - run: dotnet restore - - name: Build Nuget Versions - run: dotnet build ./tools/Explicit.NuGet.Versions/Explicit.NuGet.Versions.sln - - name: Build Release - run: dotnet build Castle.Windsor.sln -c Release - - name: Castle.Windsor.Tests - run: dotnet test src/Castle.Windsor.Tests - - name: Castle.Windsor.Extensions.DependencyInjection.Tests - run: dotnet test src/Castle.Windsor.Extensions.DependencyInjection.Tests - - name: Castle.Facilities.AspNetCore.Tests - run: dotnet test src/Castle.Facilities.AspNetCore.Tests - - name: Castle.Facilities.AspNet.SystemWeb.Tests - run: dotnet test src/Castle.Facilities.AspNet.SystemWeb.Tests - - name: Castle.Facilities.AspNet.Mvc.Tests - run: dotnet test src/Castle.Facilities.AspNet.Mvc.Tests - - name: Castle.Facilities.AspNet.WebApi.Tests - run: dotnet test src/Castle.Facilities.AspNet.WebApi.Tests - - name: Castle.Facilities.WcfIntegration.Tests - run: dotnet test src/Castle.Facilities.WcfIntegration.Tests diff --git a/.github/workflows/dotnet-ubuntu-pr.yml b/.github/workflows/dotnet.yml similarity index 94% rename from .github/workflows/dotnet-ubuntu-pr.yml rename to .github/workflows/dotnet.yml index 67e421444..d373e4b5b 100644 --- a/.github/workflows/dotnet-ubuntu-pr.yml +++ b/.github/workflows/dotnet.yml @@ -1,6 +1,10 @@ -name: .NET Ubuntu PR +name: .NET CI on: + push: + paths-ignore: + - '**.md' + - '.github/**' pull_request: branches: [ master, main ] paths-ignore: From 4f778ffa40e252f615f4c2bd07f9564b08edd449 Mon Sep 17 00:00:00 2001 From: Thomas Fuchs Date: Thu, 20 Jul 2023 15:17:05 +0200 Subject: [PATCH 5/8] Fix and run tests --- .github/workflows/dotnet-release.yml | 9 +-- .github/workflows/dotnet.yml | 73 ++++++++++++------- Castle.Windsor.sln | 6 +- .../Castle.Facilities.AspNet.Mvc.Tests.csproj | 2 +- ...e.Facilities.AspNet.SystemWeb.Tests.csproj | 2 +- ...stle.Facilities.AspNet.WebApi.Tests.csproj | 2 +- .../Castle.Facilities.AspNetCore.Tests.csproj | 2 +- .../Castle.Facilities.AspNetCore.csproj | 14 ++-- ...tle.Facilities.WcfIntegration.Tests.csproj | 2 +- .../Castle.Windsor.Tests.csproj | 9 ++- .../Config/ConfigurationTestCase.cs | 5 +- .../LoggingFacility/BaseTest.cs | 5 +- 12 files changed, 78 insertions(+), 53 deletions(-) diff --git a/.github/workflows/dotnet-release.yml b/.github/workflows/dotnet-release.yml index 3234b47ff..6d773e142 100644 --- a/.github/workflows/dotnet-release.yml +++ b/.github/workflows/dotnet-release.yml @@ -18,12 +18,9 @@ jobs: run: dotnet restore - name: Build Release run: dotnet build Castle.Windsor.sln -c Release - - name: Castle.Windsor.Tests - run: dotnet test src/Castle.Windsor.Tests - - name: Castle.Windsor.Extensions.DependencyInjection.Tests - run: dotnet test src/Castle.Windsor.Extensions.DependencyInjection.Tests - - name: Castle.Facilities.AspNetCore.Tests - run: dotnet test src/Castle.Facilities.AspNetCore.Tests + - name: Test on .NET 6.0 + run: dotnet test -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed" + deploy: needs: build-ubuntu runs-on: ubuntu-latest diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index d373e4b5b..118bdefe3 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,44 +1,67 @@ name: .NET CI on: - push: - paths-ignore: - - '**.md' - - '.github/**' pull_request: branches: [ master, main ] paths-ignore: - '**.md' - - '.github/**' jobs: build: - + name: Build and test Linux runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Setup .NET 6.0 - uses: actions/setup-dotnet@v1 + + # Building requires an up-to-date .NET SDK. + - name: Setup dotnet + uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: | + 6.0.x + 7.0.x + + # Restore and build - name: Restore dependencies - run: dotnet restore + run: dotnet restore - name: Build Nuget Versions - run: dotnet build ./tools/Explicit.NuGet.Versions/Explicit.NuGet.Versions.sln + run: dotnet build ./tools/Explicit.NuGet.Versions/Explicit.NuGet.Versions.sln - name: Build Release run: dotnet build Castle.Windsor.sln -c Release - - name: Castle.Windsor.Tests - run: dotnet test src/Castle.Windsor.Tests - - name: Castle.Windsor.Extensions.DependencyInjection.Tests - run: dotnet test src/Castle.Windsor.Extensions.DependencyInjection.Tests - - name: Castle.Facilities.AspNetCore.Tests - run: dotnet test src/Castle.Facilities.AspNetCore.Tests - - name: Castle.Facilities.AspNet.SystemWeb.Tests - run: dotnet test src/Castle.Facilities.AspNet.SystemWeb.Tests - - name: Castle.Facilities.AspNet.Mvc.Tests - run: dotnet test src/Castle.Facilities.AspNet.Mvc.Tests - - name: Castle.Facilities.AspNet.WebApi.Tests - run: dotnet test src/Castle.Facilities.AspNet.WebApi.Tests - - name: Castle.Facilities.WcfIntegration.Tests - run: dotnet test src/Castle.Facilities.WcfIntegration.Tests + + # Run tests for linux + - name: Test on .NET 6.0 + run: | + dotnet test src/Castle.Windsor.Tests -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed" + dotnet test src/Castle.Windsor.Extensions.DependencyInjection.Tests -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed" + + test-windows: + name: Build and test on Windows + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + + # Building requires an up-to-date .NET SDK. + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 7.0.x + + # Restore and build + - name: Restore dependencies + run: dotnet restore + - name: Build Release + run: dotnet build Castle.Windsor.sln -c Release + + # Run tests on windows + - name: Test on .NET Framework 4.6.2 (Windows only) + run: | + dotnet test src/Castle.Windsor.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" + dotnet test src/Castle.Facilities.AspNet.Mvc.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" + dotnet test src/Castle.Facilities.AspNet.SystemWeb.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" + dotnet test src/Castle.Facilities.AspNet.WebApi.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" + dotnet test src/Castle.Facilities.WcfIntegration.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" diff --git a/Castle.Windsor.sln b/Castle.Windsor.sln index b2e7f6ee3..f5c2203e3 100644 --- a/Castle.Windsor.sln +++ b/Castle.Windsor.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30711.63 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.33913.275 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Castle.Windsor", "src\Castle.Windsor\Castle.Windsor.csproj", "{5F6A631E-8EB1-4BC1-826D-86D3059945B8}" EndProject @@ -23,6 +23,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Castle Build", "Castle Buil build.cmd = build.cmd CHANGELOG.md = CHANGELOG.md CONTRIBUTING.md = CONTRIBUTING.md + .github\workflows\dotnet-release.yml = .github\workflows\dotnet-release.yml + .github\workflows\dotnet.yml = .github\workflows\dotnet.yml LICENSE = LICENSE README.md = README.md EndProjectSection diff --git a/src/Castle.Facilities.AspNet.Mvc.Tests/Castle.Facilities.AspNet.Mvc.Tests.csproj b/src/Castle.Facilities.AspNet.Mvc.Tests/Castle.Facilities.AspNet.Mvc.Tests.csproj index ccb068647..55ee79c2e 100644 --- a/src/Castle.Facilities.AspNet.Mvc.Tests/Castle.Facilities.AspNet.Mvc.Tests.csproj +++ b/src/Castle.Facilities.AspNet.Mvc.Tests/Castle.Facilities.AspNet.Mvc.Tests.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/Castle.Facilities.AspNet.SystemWeb.Tests/Castle.Facilities.AspNet.SystemWeb.Tests.csproj b/src/Castle.Facilities.AspNet.SystemWeb.Tests/Castle.Facilities.AspNet.SystemWeb.Tests.csproj index 76f9f3266..9b287d5a6 100644 --- a/src/Castle.Facilities.AspNet.SystemWeb.Tests/Castle.Facilities.AspNet.SystemWeb.Tests.csproj +++ b/src/Castle.Facilities.AspNet.SystemWeb.Tests/Castle.Facilities.AspNet.SystemWeb.Tests.csproj @@ -22,7 +22,7 @@ - + diff --git a/src/Castle.Facilities.AspNet.WebApi.Tests/Castle.Facilities.AspNet.WebApi.Tests.csproj b/src/Castle.Facilities.AspNet.WebApi.Tests/Castle.Facilities.AspNet.WebApi.Tests.csproj index af3796890..5c4bb1721 100644 --- a/src/Castle.Facilities.AspNet.WebApi.Tests/Castle.Facilities.AspNet.WebApi.Tests.csproj +++ b/src/Castle.Facilities.AspNet.WebApi.Tests/Castle.Facilities.AspNet.WebApi.Tests.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/Castle.Facilities.AspNetCore.Tests/Castle.Facilities.AspNetCore.Tests.csproj b/src/Castle.Facilities.AspNetCore.Tests/Castle.Facilities.AspNetCore.Tests.csproj index 4efbaf31d..a8077e09a 100644 --- a/src/Castle.Facilities.AspNetCore.Tests/Castle.Facilities.AspNetCore.Tests.csproj +++ b/src/Castle.Facilities.AspNetCore.Tests/Castle.Facilities.AspNetCore.Tests.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Castle.Facilities.AspNetCore/Castle.Facilities.AspNetCore.csproj b/src/Castle.Facilities.AspNetCore/Castle.Facilities.AspNetCore.csproj index 69d652dbd..d9e239c4e 100644 --- a/src/Castle.Facilities.AspNetCore/Castle.Facilities.AspNetCore.csproj +++ b/src/Castle.Facilities.AspNetCore/Castle.Facilities.AspNetCore.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 @@ -18,12 +18,12 @@ Castle.Facilities.AspNetCore - - - - - - + + + + + + diff --git a/src/Castle.Facilities.WcfIntegration.Tests/Castle.Facilities.WcfIntegration.Tests.csproj b/src/Castle.Facilities.WcfIntegration.Tests/Castle.Facilities.WcfIntegration.Tests.csproj index 11b5401dc..74829b457 100644 --- a/src/Castle.Facilities.WcfIntegration.Tests/Castle.Facilities.WcfIntegration.Tests.csproj +++ b/src/Castle.Facilities.WcfIntegration.Tests/Castle.Facilities.WcfIntegration.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj b/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj index 474f70187..e508112e8 100644 --- a/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj +++ b/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj @@ -1,7 +1,7 @@  - net462;netcoreapp3.1;net6.0 + net462;netcoreapp3.1;net6.0 @@ -47,7 +47,8 @@ - + + @@ -67,8 +68,8 @@ - - + + $(DefineConstants);FEATURE_THREADABORT;FEATURE_WPF;FEATURE_CONSOLETRACELISTENER diff --git a/src/Castle.Windsor.Tests/Config/ConfigurationTestCase.cs b/src/Castle.Windsor.Tests/Config/ConfigurationTestCase.cs index e8a685877..83b613b5c 100644 --- a/src/Castle.Windsor.Tests/Config/ConfigurationTestCase.cs +++ b/src/Castle.Windsor.Tests/Config/ConfigurationTestCase.cs @@ -15,7 +15,7 @@ namespace Castle.MicroKernel.Tests.Configuration { using System.Collections.Generic; - + using System.IO; using Castle.Core; using Castle.Core.Configuration; using Castle.Core.Resource; @@ -218,7 +218,8 @@ public void ShouldNotThrowCircularDependencyException() [Test] public void Can_properly_populate_array_dependency_from_xml_config_when_registering_by_convention() { - Container.Install(Configuration.FromXmlFile("config\\ComponentWithArrayDependency.config")) + var path = Path.Combine("Config", "ComponentWithArrayDependency.config"); + Container.Install(Configuration.FromXmlFile(path)) .Register(Component.For().ImplementedBy().Named("componentWithArrayDependency")); Container.Register( Classes.FromAssembly(GetCurrentAssembly()).Pick().WithServiceFirstInterface()); diff --git a/src/Castle.Windsor.Tests/LoggingFacility/BaseTest.cs b/src/Castle.Windsor.Tests/LoggingFacility/BaseTest.cs index 0fb1a9157..12616e447 100644 --- a/src/Castle.Windsor.Tests/LoggingFacility/BaseTest.cs +++ b/src/Castle.Windsor.Tests/LoggingFacility/BaseTest.cs @@ -19,6 +19,7 @@ namespace Castle.Facilities.Logging.Tests using Castle.Services.Logging.Log4netIntegration; using Castle.Services.Logging.NLogIntegration; using Castle.Windsor; + using System.IO; /// /// Summary description for BaseTest. @@ -42,12 +43,12 @@ protected string GetConfigFile() if (typeof(TLoggerFactory) == typeof(Log4netFactory) || typeof(TLoggerFactory) == typeof(ExtendedLog4netFactory)) { - return "LoggingFacility\\log4net.facilities.test.config"; + return Path.Combine("LoggingFacility", "log4net.facilities.test.config"); } if (typeof(TLoggerFactory) == typeof(NLogFactory) || typeof(TLoggerFactory) == typeof(ExtendedNLogFactory)) { - return "LoggingFacility\\NLog.facilities.test.config"; + return Path.Combine("LoggingFacility", "NLog.facilities.test.config"); } return string.Empty; } From ed6c3026c9284e61fc1330106304ab8476a89bf9 Mon Sep 17 00:00:00 2001 From: Thomas Fuchs Date: Fri, 21 Jul 2023 10:39:51 +0200 Subject: [PATCH 6/8] Split workflows for reuse --- .github/workflows/build-test-linux.yml | 33 ++++++++++++++ .github/workflows/build-test-win.yml | 34 +++++++++++++++ .github/workflows/dotnet-release.yml | 42 +++++++++--------- .github/workflows/dotnet.yml | 59 ++------------------------ Castle.Windsor.sln | 2 + 5 files changed, 94 insertions(+), 76 deletions(-) create mode 100644 .github/workflows/build-test-linux.yml create mode 100644 .github/workflows/build-test-win.yml diff --git a/.github/workflows/build-test-linux.yml b/.github/workflows/build-test-linux.yml new file mode 100644 index 000000000..75cb0f9bf --- /dev/null +++ b/.github/workflows/build-test-linux.yml @@ -0,0 +1,33 @@ +name: Build and test on linux + +on: + workflow_call: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + # Building requires an up-to-date .NET SDK. + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 7.0.x + + # Restore and build + - name: Restore dependencies + run: dotnet restore + - name: Build Nuget Versions + run: dotnet build ./tools/Explicit.NuGet.Versions/Explicit.NuGet.Versions.sln + - name: Build Release + run: dotnet build Castle.Windsor.sln -c Release + + # Run tests for linux + - name: Test on .NET 6.0 + run: | + dotnet test src/Castle.Windsor.Tests -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed" + dotnet test src/Castle.Windsor.Extensions.DependencyInjection.Tests -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed" \ No newline at end of file diff --git a/.github/workflows/build-test-win.yml b/.github/workflows/build-test-win.yml new file mode 100644 index 000000000..94391a0b9 --- /dev/null +++ b/.github/workflows/build-test-win.yml @@ -0,0 +1,34 @@ +name: Build and test on Windows + +on: + workflow_call: + +jobs: + build: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + + # Building requires an up-to-date .NET SDK. + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 6.0.x + 7.0.x + + # Restore and build + - name: Restore dependencies + run: dotnet restore + - name: Build Release + run: dotnet build Castle.Windsor.sln -c Release + + # Run tests on windows + - name: Test on .NET Framework 4.6.2 (Windows only) + run: | + dotnet test src/Castle.Windsor.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" + dotnet test src/Castle.Facilities.AspNet.Mvc.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" + dotnet test src/Castle.Facilities.AspNet.SystemWeb.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" + dotnet test src/Castle.Facilities.AspNet.WebApi.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" + dotnet test src/Castle.Facilities.WcfIntegration.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" \ No newline at end of file diff --git a/.github/workflows/dotnet-release.yml b/.github/workflows/dotnet-release.yml index 6d773e142..a801878be 100644 --- a/.github/workflows/dotnet-release.yml +++ b/.github/workflows/dotnet-release.yml @@ -6,38 +6,38 @@ on: - 'v*.*.*' jobs: - build-ubuntu: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Setup .NET 7.0 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 7.0.x - - name: Restore dependencies - run: dotnet restore - - name: Build Release - run: dotnet build Castle.Windsor.sln -c Release - - name: Test on .NET 6.0 - run: dotnet test -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed" + build-lin: + name: Build and test Linux + uses: ./.github/workflows/build-test-linux.yml + + build-win: + name: Build and test on Windows + uses: ./.github/workflows/build-test-win.yml deploy: - needs: build-ubuntu + needs: [build-lin, build-win] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Setup .NET Core - uses: actions/setup-dotnet@v1 + - uses: actions/checkout@v3 + + # Building requires an up-to-date .NET SDK. + - name: Setup dotnet + uses: actions/setup-dotnet@v3 with: - dotnet-version: 7.0.x + dotnet-version: | + 6.0.x + 7.0.x + - name: Restore dependencies run: dotnet restore - name: Get the version id: get_version run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | cut -d "v" -f 2) + - name: Build run: dotnet build Castle.Windsor.sln --configuration Release - name: Pack - run: dotnet pack Castle.Windsor.sln -c Release -o ./artifacts -p:PackageVersion=${{ steps.get_version.outputs.VERSION }} + run: dotnet pack Castle.Windsor.sln -c Release -o artifacts -p:PackageVersion=${{ steps.get_version.outputs.VERSION }} + - name: Push generated Rebus package to GitHub registry - run: dotnet nuget push /home/runner/work/Windsor/Windsor/artifacts/Castle.Windsor.${{ steps.get_version.outputs.VERSION }}.nupkg -k ${{secrets.NUGET_SECRET_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols \ No newline at end of file + run: dotnet nuget push artifacts -k ${{secrets.NUGET_SECRET_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols \ No newline at end of file diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 118bdefe3..250e6544e 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -7,61 +7,10 @@ on: - '**.md' jobs: - build: + build-lin: name: Build and test Linux - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - # Building requires an up-to-date .NET SDK. - - name: Setup dotnet - uses: actions/setup-dotnet@v3 - with: - dotnet-version: | - 6.0.x - 7.0.x - - # Restore and build - - name: Restore dependencies - run: dotnet restore - - name: Build Nuget Versions - run: dotnet build ./tools/Explicit.NuGet.Versions/Explicit.NuGet.Versions.sln - - name: Build Release - run: dotnet build Castle.Windsor.sln -c Release - - # Run tests for linux - - name: Test on .NET 6.0 - run: | - dotnet test src/Castle.Windsor.Tests -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed" - dotnet test src/Castle.Windsor.Extensions.DependencyInjection.Tests -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed" + uses: ./.github/workflows/build-test-linux.yml - test-windows: + build-win: name: Build and test on Windows - runs-on: windows-latest - - steps: - - uses: actions/checkout@v2 - - # Building requires an up-to-date .NET SDK. - - name: Setup dotnet - uses: actions/setup-dotnet@v3 - with: - dotnet-version: | - 6.0.x - 7.0.x - - # Restore and build - - name: Restore dependencies - run: dotnet restore - - name: Build Release - run: dotnet build Castle.Windsor.sln -c Release - - # Run tests on windows - - name: Test on .NET Framework 4.6.2 (Windows only) - run: | - dotnet test src/Castle.Windsor.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" - dotnet test src/Castle.Facilities.AspNet.Mvc.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" - dotnet test src/Castle.Facilities.AspNet.SystemWeb.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" - dotnet test src/Castle.Facilities.AspNet.WebApi.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" - dotnet test src/Castle.Facilities.WcfIntegration.Tests -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed" + uses: ./.github/workflows/build-test-win.yml diff --git a/Castle.Windsor.sln b/Castle.Windsor.sln index f5c2203e3..d438cb73f 100644 --- a/Castle.Windsor.sln +++ b/Castle.Windsor.sln @@ -20,6 +20,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Castle Build", "Castle Buil .gitattributes = .gitattributes .gitignore = .gitignore appveyor.yml = appveyor.yml + .github\workflows\build-test-linux.yml = .github\workflows\build-test-linux.yml + .github\workflows\build-test-win.yml = .github\workflows\build-test-win.yml build.cmd = build.cmd CHANGELOG.md = CHANGELOG.md CONTRIBUTING.md = CONTRIBUTING.md From 456278f109b5778d8fd8e471991db9bbe6191ebe Mon Sep 17 00:00:00 2001 From: Thomas Fuchs Date: Fri, 21 Jul 2023 10:59:50 +0200 Subject: [PATCH 7/8] Run ASP tests as NET6 --- .github/workflows/build-test-linux.yml | 3 ++- .../Castle.Facilities.AspNetCore.Tests.csproj | 6 +++--- src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test-linux.yml b/.github/workflows/build-test-linux.yml index 75cb0f9bf..37880ad8b 100644 --- a/.github/workflows/build-test-linux.yml +++ b/.github/workflows/build-test-linux.yml @@ -30,4 +30,5 @@ jobs: - name: Test on .NET 6.0 run: | dotnet test src/Castle.Windsor.Tests -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed" - dotnet test src/Castle.Windsor.Extensions.DependencyInjection.Tests -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed" \ No newline at end of file + dotnet test src/Castle.Facilities.AspNetCore.Tests -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed" + dotnet test src/Castle.Windsor.Extensions.DependencyInjection.Tests -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed" diff --git a/src/Castle.Facilities.AspNetCore.Tests/Castle.Facilities.AspNetCore.Tests.csproj b/src/Castle.Facilities.AspNetCore.Tests/Castle.Facilities.AspNetCore.Tests.csproj index a8077e09a..db42d80d6 100644 --- a/src/Castle.Facilities.AspNetCore.Tests/Castle.Facilities.AspNetCore.Tests.csproj +++ b/src/Castle.Facilities.AspNetCore.Tests/Castle.Facilities.AspNetCore.Tests.csproj @@ -1,13 +1,13 @@ - + - netcoreapp3.1 + net6.0 - + diff --git a/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj b/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj index e508112e8..f0e9932ea 100644 --- a/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj +++ b/src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj @@ -54,7 +54,7 @@ - + @@ -68,7 +68,7 @@ - + $(DefineConstants);FEATURE_THREADABORT;FEATURE_WPF;FEATURE_CONSOLETRACELISTENER From 48c19e27546c882a442ca4dbf7e3dc844ceb71ec Mon Sep 17 00:00:00 2001 From: Thomas Fuchs Date: Thu, 27 Jul 2023 12:06:13 +0200 Subject: [PATCH 8/8] Push packages to github --- .github/workflows/dotnet-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet-release.yml b/.github/workflows/dotnet-release.yml index a801878be..1269a9538 100644 --- a/.github/workflows/dotnet-release.yml +++ b/.github/workflows/dotnet-release.yml @@ -35,9 +35,9 @@ jobs: run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3 | cut -d "v" -f 2) - name: Build - run: dotnet build Castle.Windsor.sln --configuration Release + run: dotnet build Castle.Windsor.sln -c Release - name: Pack run: dotnet pack Castle.Windsor.sln -c Release -o artifacts -p:PackageVersion=${{ steps.get_version.outputs.VERSION }} - - name: Push generated Rebus package to GitHub registry - run: dotnet nuget push artifacts -k ${{secrets.NUGET_SECRET_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols \ No newline at end of file + - name: Push generated NuGet packages to GitHub Packages + run: dotnet nuget push "artifacts/*.nupkg" -k ${{secrets.GITHUB_TOKEN}} -s https://nuget.pkg.github.com/castleproject/index.json --skip-duplicate --no-symbols \ No newline at end of file