Skip to content

Commit

Permalink
test: add net462 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phnx47 committed Nov 15, 2023
1 parent dc64675 commit 6f2d751
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- "main"
- "ci/windows"
tags:
- "v*"
pull_request:
Expand All @@ -12,28 +13,29 @@ on:
workflow_dispatch:

jobs:
build:
name: Build & Test
runs-on: ubuntu-22.04
build-windows:
name: Build & Test (Windows)
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
5.0.x
6.0.x
7.0.x
- name: Run tests
run: dotnet test -c Release

- name: Restore
run: dotnet restore
build-linux:
name: Build, Test & Pack (Linux)
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build
run: dotnet build --no-restore -c Release -p:ContinuousIntegrationBuild=true
run: dotnet build -c Release -p:ContinuousIntegrationBuild=true

- name: Run tests
run: dotnet test --no-build -c Release
Expand Down Expand Up @@ -62,7 +64,7 @@ jobs:

github:
name: Deploy to GitHub
needs: [build]
needs: [build-windows, build-linux]
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-22.04
steps:
Expand All @@ -75,7 +77,7 @@ jobs:

nuget:
name: Deploy to NuGet
needs: [build]
needs: [build-windows, build-linux]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-22.04
steps:
Expand Down
11 changes: 7 additions & 4 deletions tests/units/FingerprintBuilder.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>11.0</LangVersion>
<TargetFrameworks>net5.0;net6.0;net7.0</TargetFrameworks>
<TargetFramework Condition="'$(OS)' != 'Windows_NT'">net6.0</TargetFramework>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net462;net6.0</TargetFrameworks>
<CollectCoverage>true</CollectCoverage>
<CoverletOutputFormat>opencover</CoverletOutputFormat>
<NoWarn>$(NoWarn);CS0618</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' != 'net5.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
<DefineConstants>$(DefineConstants);HasNewTypes</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Condition="'$(TargetFramework)' != 'net5.0'" Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageReference Condition="'$(TargetFramework)' == 'net5.0'" Include="xunit.runner.visualstudio" Version="2.4.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down

0 comments on commit 6f2d751

Please sign in to comment.