Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test merge for actions #1

Closed
wants to merge 7 commits into from
Closed
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
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: nuget
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
target-branch: master
43 changes: 43 additions & 0 deletions .github/workflows/dotnet-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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: 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
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
85 changes: 85 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: .NET CI

on:
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

# Install all supported .NET versions
- name: Install .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x

# Building requires an up-to-date .NET SDK.
- name: Install .NET 7.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 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 Core 3.1
run: dotnet test -c Release -f netcoreapp3.1 --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"

test-windows:
name: Build and test on Windows
runs-on: windows-latest

steps:
- uses: actions/checkout@v2

# 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@v1
with:
dotnet-version: 2.1.x

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

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

# Building requires an up-to-date .NET SDK.
- name: Install .NET 7.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x

# Run tests on windows
- name: Test on .NET Framework 4.6.2 (Windows only)
run: dotnet test -c Release -f net462 -l "console;verbosity=detailed"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ _ReSharper*/
build/
bin/
obj/
.idea
8 changes: 2 additions & 6 deletions src/Castle.Windsor.Tests/Castle.Windsor.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net462;netcoreapp3.1;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\buildscripts\common.props"></Import>
Expand Down Expand Up @@ -45,7 +45,7 @@

<ItemGroup>
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
</ItemGroup>

Expand All @@ -69,8 +69,4 @@
<Reference Include="WindowsBase" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net462'">
<DefineConstants>$(DefineConstants);FEATURE_THREADABORT;FEATURE_WPF;FEATURE_CONSOLETRACELISTENER</DefineConstants>
</PropertyGroup>

</Project>
5 changes: 3 additions & 2 deletions src/Castle.Windsor.Tests/Config/ConfigurationTestCase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<IConfig>().ImplementedBy<Config>().Named("componentWithArrayDependency"));
Container.Register(
Classes.FromAssembly(GetCurrentAssembly()).Pick().WithServiceFirstInterface());
Expand Down