Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 12 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Build

on: [ push, pull_request ]

env:
MONO_TAG: "6.0.0.334"

jobs:

build-and-test:
Expand All @@ -28,31 +25,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

# Several .NET Core versions will be used during the test run.
# The lowest version gets installed first in order to prevent
# "a newer version is already installed" install errors.

- name: Install .NET Core 2.1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 2.1.x

- name: Install .NET Core 3.1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 3.1.x

- name: Install .NET 6.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x

# Building requires an up-to-date .NET SDK.
# -----
# Setup .NET sdk
# -----

- name: Install .NET 7.0
- name: Install .NET SDKs
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
dotnet-version: |
8.0.x
9.0.x

# -----
# Build
Expand All @@ -68,20 +50,12 @@ jobs:
# Test
# ----

- name: Test on .NET Core 2.1
run: dotnet test -c Release -f netcoreapp2.1 --no-build --no-restore -l "console;verbosity=detailed"

- name: Test on .NET Core 3.1
run: dotnet test -c Release -f netcoreapp3.1 --no-build --no-restore -l "console;verbosity=detailed"
- name: Test on .NET 8.0
run: dotnet test -c Release -f net8.0 --no-build --no-restore -l "console;verbosity=detailed"

- name: Test on .NET 6.0
run: dotnet test -c Release -f net6.0 --no-build --no-restore -l "console;verbosity=detailed"
- name: Test on .NET 9.0
run: dotnet test -c Release -f net9.0 --no-build --no-restore -l "console;verbosity=detailed"

- name: Test on .NET Framework 4.6.2 (Windows only)
if: matrix.os == 'windows-latest'
run: dotnet test -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed"

- name: Test on .NET Framework 4.6.2 using Mono (Linux only)
if: matrix.os == 'ubuntu-latest'
run: |
docker run --rm -v "$PWD":'/project' -w='/project' mono:$MONO_TAG bash -c 'mono ./src/Castle.Core.Tests/bin/Release/net462/Castle.Core.Tests.exe && mono ./src/Castle.Core.Tests.WeakNamed/bin/Release/net462/Castle.Core.Tests.WeakNamed.exe'
run: dotnet test -c Release -f net462 --no-build --no-restore -l "console;verbosity=detailed"
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Castle Core Changelog

## Next

Enhancements:
- Now target frameworks are: .NET 8, .NET Framework 4.6.2, .NET Standard 2.0
- Tests platforms now are: .NET Framework 4.6.2, .NET 8, .NET 9
- Dependencies were updated

Deprecations:
- .NET Core 2.1, .NET Core 3.1, .NET 6, and mono tests
- .NET Standard 2.1 tfm

## 5.2.1 (2025-03-09)

(Note: Version 5.2.0 was skipped due to issues with the automated CI release process.)
Expand Down
10 changes: 4 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
image:
- Visual Studio 2022
- Ubuntu
- Ubuntu2204


# ----------------
Expand All @@ -16,7 +16,7 @@ for:
# -----------------
matrix:
only:
- image: Ubuntu
- image: Ubuntu2204

# build and run tests
build_script:
Expand Down Expand Up @@ -54,10 +54,8 @@ for:
after_build:
- ps: |
$wc = New-Object System.Net.WebClient
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "NetCoreClrTestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "NetCoreClrWeakNamedTestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "Net60TestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "Net60WeakNamedTestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "Net80TestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "Net80WeakNamedTestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "DesktopClrTestResults.xml"))
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path "DesktopClrWeakNamedTestResults.xml"))

Expand Down
72 changes: 11 additions & 61 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,81 +15,31 @@
# ****************************************************************************
shopt -s expand_aliases

DOTNETPATH=$(which dotnet)
if [ ! -f "$DOTNETPATH" ]; then
echo "Please install Microsoft/netcore from: https://www.microsoft.com/net/core"
exit 1
fi

DOCKERPATH=$(which docker)
if [ -f "$DOCKERPATH" ]; then
alias mono="$PWD/buildscripts/docker-run-mono.sh"
else
MONOPATH=$(which mono)
if [ ! -f "$MONOPATH" ]; then
echo "Please install either Docker, or Xamarin/Mono from http://www.mono-project.com/docs/getting-started/install/"
exit 1
fi
fi

mono --version

# Linux/Darwin
OSNAME=$(uname -s)
echo "OSNAME: $OSNAME"

dotnet build --configuration Release || exit 1

echo --------------------
echo Running NET462 Tests
echo --------------------

mono ./src/Castle.Core.Tests/bin/Release/net462/Castle.Core.Tests.exe --result=DesktopClrTestResults.xml;format=nunit3
mono ./src/Castle.Core.Tests.WeakNamed/bin/Release/net462/Castle.Core.Tests.WeakNamed.exe --result=DesktopClrWeakNamedTestResults.xml;format=nunit3
dotnet --list-sdks

echo ---------------------------
echo Running NETCOREAPP3.1 Tests
echo Build
echo ---------------------------

dotnet ./src/Castle.Core.Tests/bin/Release/netcoreapp3.1/Castle.Core.Tests.dll --result=NetCoreClrTestResults.xml;format=nunit3
dotnet ./src/Castle.Core.Tests.WeakNamed/bin/Release/netcoreapp3.1/Castle.Core.Tests.WeakNamed.dll --result=NetCoreClrWeakNamedTestResults.xml;format=nunit3
dotnet build ./Castle.Core.sln --configuration Release --tl:off

echo ---------------------------
echo Running NET6.0 Tests
echo Running NET8.0 Tests
echo ---------------------------

dotnet ./src/Castle.Core.Tests/bin/Release/net6.0/Castle.Core.Tests.dll --result=Net60TestResults.xml;format=nunit3
dotnet ./src/Castle.Core.Tests.WeakNamed/bin/Release/net6.0/Castle.Core.Tests.WeakNamed.dll --result=Net60WeakNamedTestResults.xml;format=nunit3
dotnet ./src/Castle.Core.Tests/bin/Release/net8.0/Castle.Core.Tests.dll --result=Net80TestResults.xml;format=nunit3
dotnet ./src/Castle.Core.Tests.WeakNamed/bin/Release/net8.0/Castle.Core.Tests.WeakNamed.dll --result=Net80WeakNamedTestResults.xml;format=nunit3

# Ensure that all test runs produced a protocol file:
if [[ !( -f NetCoreClrTestResults.xml &&
-f NetCoreClrWeakNamedTestResults.xml &&
-f Net60TestResults.xml &&
-f Net60WeakNamedTestResults.xml &&
-f DesktopClrTestResults.xml &&
-f DesktopClrWeakNamedTestResults.xml ) ]]; then
if [[ !( -f Net80TestResults.xml &&
-f Net80WeakNamedTestResults.xml ) ]]; then
echo "Incomplete test results. Some test runs might not have terminated properly. Failing the build."
exit 1
fi

# Unit test failure
NETCORE_FAILCOUNT=$(grep -F "One or more child tests had errors" NetCoreClrTestResults.xml NetCoreClrWeakNamedTestResults.xml | wc -l)
if [ $NETCORE_FAILCOUNT -ne 0 ]
then
echo "NetCore Tests have failed, failing the build"
exit 1
fi

NET60_FAILCOUNT=$(grep -F "One or more child tests had errors" Net60TestResults.xml Net60WeakNamedTestResults.xml | wc -l)
if [ $NET60_FAILCOUNT -ne 0 ]
then
echo "Net6.0 Tests have failed, failing the build"
exit 1
fi

MONO_FAILCOUNT=$(grep -F "One or more child tests had errors" DesktopClrTestResults.xml DesktopClrWeakNamedTestResults.xml | wc -l)
if [ $MONO_FAILCOUNT -ne 0 ]
NET80_FAILCOUNT=$(grep -F "One or more child tests had errors" Net80TestResults.xml Net80WeakNamedTestResults.xml | wc -l)
if [ $NET80_FAILCOUNT -ne 0 ]
then
echo "DesktopClr Tests have failed, failing the build"
echo "Net8.0 Tests have failed, failing the build"
exit 1
fi
18 changes: 5 additions & 13 deletions buildscripts/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,12 @@ echo --------------------
echo Running NET462 Tests
echo --------------------

%UserProfile%\.nuget\packages\nunit.consolerunner\3.11.1\tools\nunit3-console.exe src/Castle.Core.Tests/bin/%Configuration%/net462/Castle.Core.Tests.exe --result=DesktopClrTestResults.xml;format=nunit3 || exit /b 1
%UserProfile%\.nuget\packages\nunit.consolerunner\3.11.1\tools\nunit3-console.exe src/Castle.Core.Tests.WeakNamed/bin/%Configuration%/net462/Castle.Core.Tests.WeakNamed.exe --result=DesktopClrWeakNamedTestResults.xml;format=nunit3 || exit /b 1
src\Castle.Core.Tests\bin\%Configuration%\net462\Castle.Core.Tests.exe --result=DesktopClrTestResults.xml;format=nunit3 || exit /b 1
src\Castle.Core.Tests.WeakNamed\bin\%Configuration%\net462\Castle.Core.Tests.WeakNamed.exe --result=DesktopClrWeakNamedTestResults.xml;format=nunit3 || exit /b 1

echo ---------------------------
echo Running NETCOREAPP3.1 Tests
echo Running NET8.0 Tests
echo ---------------------------

dotnet .\src\Castle.Core.Tests\bin\%Configuration%\netcoreapp3.1\Castle.Core.Tests.dll --result=NetCoreClrTestResults.xml;format=nunit3 || exit /b 1
dotnet .\src\Castle.Core.Tests.WeakNamed\bin\%Configuration%\netcoreapp3.1/Castle.Core.Tests.WeakNamed.dll --result=NetCoreClrWeakNamedTestResults.xml;format=nunit3 || exit /b 1


echo ---------------------------
echo Running NET6.0 Tests
echo ---------------------------

dotnet .\src\Castle.Core.Tests\bin\%Configuration%\net6.0\Castle.Core.Tests.dll --result=Net60TestResults.xml;format=nunit3 || exit /b 1
dotnet .\src\Castle.Core.Tests.WeakNamed\bin\%Configuration%\net6.0/Castle.Core.Tests.WeakNamed.dll --result=Net60WeakNamedTestResults.xml;format=nunit3 || exit /b 1
dotnet .\src\Castle.Core.Tests\bin\%Configuration%\net8.0\Castle.Core.Tests.dll --result=Net80TestResults.xml;format=nunit3 || exit /b 1
dotnet .\src\Castle.Core.Tests.WeakNamed\bin\%Configuration%\net8.0/Castle.Core.Tests.WeakNamed.dll --result=Net80WeakNamedTestResults.xml;format=nunit3 || exit /b 1
28 changes: 2 additions & 26 deletions buildscripts/common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<LangVersion>11.0</LangVersion>
<LangVersion>13.0</LangVersion>
<NoWarn>$(NoWarn);CS1591;CS3014;CS3003;CS3001;CS3021</NoWarn>
<NoWarn>$(NoWarn);CS0612;CS0618</NoWarn> <!-- TODO: Remove this line once `[Obsolete]` members have been dealt with. -->
<RepositoryType>git</RepositoryType>
Expand Down Expand Up @@ -40,7 +40,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup>
Expand All @@ -66,30 +66,6 @@
<DefineConstants>$(NetStandard20Constants)</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='netstandard2.1|Debug'">
<DefineConstants>$(DiagnosticsConstants);$(NetStandard21Constants)</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='netstandard2.1|Release'">
<DefineConstants>$(NetStandard21Constants)</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='netcoreapp2.1|Debug'">
<DefineConstants>$(DiagnosticsConstants);$(NetStandard20Constants)</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='netcoreapp2.1|Release'">
<DefineConstants>$(NetStandard20Constants)</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='netcoreapp3.1|Debug'">
<DefineConstants>$(DiagnosticsConstants);$(NetStandard21Constants)</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)|$(Configuration)'=='netcoreapp3.1|Release'">
<DefineConstants>$(NetStandard21Constants)</DefineConstants>
</PropertyGroup>

<ItemGroup>
<None Include="$(SolutionDir)docs\images\castle-logo.png" Pack="true" PackagePath=""/>
</ItemGroup>
Expand Down
4 changes: 0 additions & 4 deletions buildscripts/docker-run-mono.sh

This file was deleted.

Loading
Loading