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
12 changes: 0 additions & 12 deletions .config/dotnet-tools.json

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI
run-name: CI ${{ github.event.pull_request.title }}

on:
pull_request:

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8
9
10

- name: Build projects
run: dotnet build
shell: bash

- name: Run tests
run: dotnet test /p:BuildTestOnly=true
shell: bash
34 changes: 0 additions & 34 deletions .github/workflows/pull-request.yml

This file was deleted.

44 changes: 27 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Release
run-name: Release ${{ github.ref_name }}

on:
push:
Expand All @@ -11,36 +12,45 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v6

- name: Use .NET SDK from global.json
uses: actions/setup-dotnet@v3
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8
9
10

- name: Extract package version
run: echo "PACKAGE_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
shell: bash

- name: Extract assembly version
run: echo "ASSEMBLY_VERSION=$(echo ${{ github.ref_name }} | grep -o '^[0-9]*\.[0-9]*\.[0-9]*').0" >> $GITHUB_ENV
- name: Extract version
id: extract_version
shell: bash
run: |
PACKAGE_VERSION="${{ github.ref_name }}"
ASSEMBLY_VERSION="$(echo ${{ github.ref_name }} | grep -o '^[0-9]*\.[0-9]*\.[0-9]*').0"
echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
echo "assembly_version=$ASSEMBLY_VERSION" >> $GITHUB_OUTPUT
echo "Package Version: $PACKAGE_VERSION"
echo "Assembly Version: $ASSEMBLY_VERSION"

- name: Build projects
run: |
for sln in $(find . -name '*.sln'); do
echo -e "\n\033[0;34mBuilding $sln \033[0m"
dotnet build "$sln" -c Release /p:Version=${{ env.PACKAGE_VERSION }} /p:AssemblyVersion=${{ env.ASSEMBLY_VERSION }} /p:FileVersion=${{ env.ASSEMBLY_VERSION }}
done
shell: bash
run: dotnet build -c Release

- name: Pack
run: find . -name '*.sln' | parallel --jobs 0 'dotnet pack {} /p:PackageVersion=${{env.PACKAGE_VERSION}} -c Release -o ./out --no-build --include-symbols --include-source --verbosity Minimal'
shell: bash
run: |
dotnet pack \
-c Release -o \
./out --no-build \
--include-symbols \
--include-source \
--verbosity Minimal \
/p:Version=${{ steps.extract_version.outputs.package_version }} \
/p:AssemblyVersion=${{ steps.extract_version.outputs.assembly_version }} \
/p:FileVersion=${{ steps.extract_version.outputs.assembly_version }}

- name: Push
run: |
find . -name '*.nupkg' | grep -v '.sources.nupkg' | parallel --jobs 0 'dotnet nuget push {} --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json'
shell: bash
run: |
find . -name '*.nupkg' | grep -v '.sources.nupkg' | parallel --jobs 0 'dotnet nuget push {} --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json'
33 changes: 30 additions & 3 deletions src/Package.props → Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
<Project>
<PropertyGroup>
<NoWarn>$(NoWarn);SYSLIB1006;SYSLIB1015;CS8618;CS8602</NoWarn>
</PropertyGroup>

<PropertyGroup>
<TestProjectTargetFrameworks>net8.0;net9.0;net10.0</TestProjectTargetFrameworks>
<TargetFrameworks>netstandard2.0;net462;net8.0;net9.0;net10.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>Full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<PropertyGroup>
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<IsApp>false</IsApp>
<IsPublishable>false</IsPublishable>
</PropertyGroup>

<PropertyGroup>
<Version Condition="$(Version) == ''">0.0.0</Version>
<Product>Snapshooter</Product>
<Authors>Swiss Life authors and contributors</Authors>
<Company>Swiss Life</Company>
Expand All @@ -11,8 +39,7 @@
<PackageTags>XUnit SwissLife Snapshot UnitTest Test IntegrationTest SystemTest DatabaseTest .Net</PackageTags>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageIconUrl>https://github.com/SwissLife-OSS/snapshooter/raw/master/logo.png</PackageIconUrl>
<IsPackable>false</IsPackable>
<LangVersion>11.0</LangVersion>
<RepositoryType>GIT</RepositoryType>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -26,7 +53,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions all.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.Build.Traversal/4.1.82">

<PropertyGroup>
<BuildTestOnly>false</BuildTestOnly>
<IncludeInSolutionFile>false</IncludeInSolutionFile>
</PropertyGroup>

<ItemGroup Condition="$(BuildTestOnly) != 'true'">
<ProjectReference Include="**/*.csproj" />
</ItemGroup>

<ItemGroup Condition="$(BuildTestOnly) != 'true'">
<ProjectReference Include="**/test/*.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFrameworks></TargetFrameworks>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand Down
3 changes: 1 addition & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"sdk": {
"version": "9.0.101",
"rollForward": "latestMinor"
"version": "10.0.100"
}
}
8 changes: 8 additions & 0 deletions samples/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\'))" />

<PropertyGroup>
<TargetFrameworks></TargetFrameworks>
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7</TargetFramework>
<IsPackable>false</IsPackable>
<AssemblyName>Snapshooter.Examples.Xunit</AssemblyName>
<RootNamespace>Snapshooter.Examples.Xunit</RootNamespace>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
Expand All @@ -17,10 +14,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 0 additions & 3 deletions samples/Snapshooter.Tests.Data/Snapshooter.Tests.Data.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7</TargetFramework>
<AssemblyName>Snapshooter.Tests.Data</AssemblyName>
<RootNamespace>Snapshooter.Tests.Data</RootNamespace>
<IsPackable>false</IsPackable>
<IsTestProject>false</IsTestProject>
</PropertyGroup>

</Project>
5 changes: 0 additions & 5 deletions src/Dependencies.props

This file was deleted.

15 changes: 1 addition & 14 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
<Project>
<PropertyGroup>
<CCSourceDirectory>$(MSBuildThisFileDirectory.TrimEnd('\').TrimEnd('/'))</CCSourceDirectory>
<CCSettingsProps>$([System.IO.Path]::Combine($(CCSourceDirectory), 'Settings.props'))</CCSettingsProps>
<CCVersionProps>$([System.IO.Path]::Combine($(CCSourceDirectory), 'Version.props'))</CCVersionProps>
<CCPackageProps>$([System.IO.Path]::Combine($(CCSourceDirectory), 'Package.props'))</CCPackageProps>
<CCResourceProjectProps>$([System.IO.Path]::Combine($(CCSourceDirectory), 'ResourceProject.props'))</CCResourceProjectProps>
<CCDependenciesProps>$([System.IO.Path]::Combine($(CCSourceDirectory), 'Dependencies.props'))</CCDependenciesProps>
</PropertyGroup>

<Import Project="$(CCDependenciesProps)" Condition="Exists('$(CCDependenciesProps)')"/>
<Import Project="$(CCSettingsProps)" Condition="Exists('$(CCSettingsProps)')"/>
<Import Project="$(CCVersionProps)" Condition="Exists('$(CCVersionProps)')"/>
<Import Project="$(CCPackageProps)" Condition="Exists('$(CCPackageProps)')"/>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\'))" />
</Project>
6 changes: 0 additions & 6 deletions src/Directory.Build.targets

This file was deleted.

19 changes: 0 additions & 19 deletions src/ResourceProject.props

This file was deleted.

5 changes: 2 additions & 3 deletions src/Snapshooter.Json/Snapshooter.Json.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(CCResourceProjectProps)" Condition="Exists('$(CCResourceProjectProps)')" />


<PropertyGroup>
<AssemblyName>Snapshooter.Json</AssemblyName>
<RootNamespace>Snapshooter.Json</RootNamespace>
Expand All @@ -9,7 +8,7 @@
Json Snapshooter is a flexible snapshot testing tool for .Net unit tests.
It creates and asserts json snapshots in unit tests without any .Net test framework required.
</Description>
<IsTestProject>false</IsTestProject>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/Snapshooter.MSTest/Snapshooter.MSTest.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(CCResourceProjectProps)" Condition="Exists('$(CCResourceProjectProps)')" />


<PropertyGroup>
<AssemblyName>Snapshooter.MSTest</AssemblyName>
<RootNamespace>Snapshooter.MSTest</RootNamespace>
Expand All @@ -9,7 +8,7 @@
MSTest Snapshooter is a flexible snapshot testing tool for .Net unit tests with MSTest.
It creates and asserts snapshots (json format) within MSTest unit tests.
</Description>
<IsTestProject>false</IsTestProject>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/Snapshooter.NUnit/Snapshooter.NUnit.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(CCResourceProjectProps)" Condition="Exists('$(CCResourceProjectProps)')" />


<PropertyGroup>
<AssemblyName>Snapshooter.NUnit</AssemblyName>
<RootNamespace>Snapshooter.NUnit</RootNamespace>
Expand All @@ -9,7 +8,7 @@
NUnit Snapshooter is a flexible snapshot testing tool for .Net unit tests with NUnit.
It creates and asserts snapshots (json format) within NUnit unit tests.
</Description>
<IsTestProject>false</IsTestProject>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
Expand Down
Loading
Loading