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
13 changes: 6 additions & 7 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ permissions:

jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
dotnet-version: [ '9.0.x' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET ${{ matrix.dotnet-version }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
dotnet-version: |
6.0.x
8.0.x
9.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,18 @@ jobs:
echo "Version tag '${{ steps.get_version.outputs.version }}' does not exist. Proceeding with release process."

build-and-test:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
needs: check-version-tag
if: needs.check-version-tag.outputs.is_new_version == 'true'
strategy:
matrix:
os: [ubuntu-latest]
dotnet-version: [ '9.0.x' ]
steps:
- uses: actions/checkout@v4
- name: Setup .NET ${{ matrix.dotnet-version }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet-version }}
dotnet-version: |
6.0.x
8.0.x
9.0.x

- name: Restore dependencies
run: dotnet restore
Expand Down Expand Up @@ -158,7 +157,10 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
dotnet-version: |
6.0.x
8.0.x
9.0.x

- name: Restore dependencies
run: dotnet restore
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net6.0'">
<PackageReference Include="System.Text.Json" Version="9.0.10" />
</ItemGroup>

Expand Down
14 changes: 12 additions & 2 deletions ReflectorNet.Tests/ReflectorNet.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net6.0'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="System.Text.Json" Version="9.0.10" />
<PackageReference Include="xunit" Version="2.9.3" />
Expand Down
7 changes: 6 additions & 1 deletion ReflectorNet.Tests/SchemaTests/CollectionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@ public void GetTypeId_SimpleArray_ShouldAppendArray()
foreach (var type in _collectionTypes)
{
var result = reflector.GetSchema(type);
var options = new JsonSerializerOptions
{
TypeInfoResolver = new System.Text.Json.Serialization.Metadata.DefaultJsonTypeInfoResolver(),
WriteIndented = true
};

_output.WriteLine($"Type: {type.GetTypeShortName()}\n{result.ToJsonString(new JsonSerializerOptions { WriteIndented = true })}\n");
_output.WriteLine($"Type: {type.GetTypeShortName()}\n{result.ToJsonString(options)}\n");

// Assert
Assert.NotNull(result);
Expand Down
Loading
Loading