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 bbf41ec
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 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
9 changes: 6 additions & 3 deletions tests/units/FingerprintBuilder.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<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>
Expand All @@ -12,8 +13,10 @@
<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 bbf41ec

Please sign in to comment.