Add CI + Tests
This commit is contained in:
Родитель
63c098c752
Коммит
f762a824c9
|
@ -0,0 +1,2 @@
|
|||
github: SixLabors
|
||||
open_collective: sixlabors
|
|
@ -0,0 +1,11 @@
|
|||
### Prerequisites
|
||||
|
||||
- [ ] I have written a descriptive pull-request title
|
||||
- [ ] I have verified that there are no overlapping [pull-requests](https://github.com/SixLabors/SharedInfrastructure/pulls) open
|
||||
- [ ] I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules :cop:.
|
||||
- [ ] I have provided test coverage for my change (where applicable)
|
||||
|
||||
### Description
|
||||
<!-- A description of the changes proposed in the pull-request -->
|
||||
|
||||
<!-- Thanks for contributing to SharedInfrastructure! -->
|
|
@ -0,0 +1,68 @@
|
|||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
Build:
|
||||
strategy:
|
||||
matrix:
|
||||
options:
|
||||
- os: ubuntu-latest
|
||||
framework: netcoreapp3.1
|
||||
runtime: -x64
|
||||
codecov: false
|
||||
- os: windows-latest
|
||||
framework: netcoreapp3.1
|
||||
runtime: -x64
|
||||
codecov: true
|
||||
- os: windows-latest
|
||||
framework: netcoreapp2.1
|
||||
runtime: -x64
|
||||
codecov: false
|
||||
- os: windows-latest
|
||||
framework: net472
|
||||
runtime: -x64
|
||||
codecov: false
|
||||
- os: windows-latest
|
||||
framework: net472
|
||||
runtime: -x86
|
||||
codecov: false
|
||||
|
||||
runs-on: ${{matrix.options.os}}
|
||||
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install NuGet
|
||||
uses: NuGet/setup-nuget@v1
|
||||
|
||||
- name: Setup Git
|
||||
shell: bash
|
||||
run: |
|
||||
git config --global core.autocrlf false
|
||||
git config --global core.longpaths true
|
||||
git fetch --prune --unshallow
|
||||
git submodule -q update --init --recursive
|
||||
|
||||
- name: Build
|
||||
shell: pwsh
|
||||
run: ./ci-build.ps1 "${{matrix.options.framework}}"
|
||||
|
||||
- name: Test
|
||||
shell: pwsh
|
||||
run: ./ci-test.ps1 "${{matrix.options.os}}" "${{matrix.options.framework}}" "${{matrix.options.runtime}}" "${{matrix.options.codecov}}"
|
||||
env:
|
||||
CI: True
|
||||
XUNIT_PATH: .\tests\SharedInfrastructure.Tests # Required for xunit
|
||||
|
||||
- name: Update Codecov
|
||||
uses: codecov/codecov-action@v1
|
||||
if: matrix.options.codecov == true && startsWith(github.repository, 'SixLabors')
|
||||
with:
|
||||
flags: unittests
|
86
README.md
86
README.md
|
@ -5,6 +5,14 @@
|
|||
SixLabors.SharedInfrastructure
|
||||
</h1>
|
||||
|
||||
<div align="center">
|
||||
|
||||
[![Build Status](https://img.shields.io/github/workflow/status/SixLabors/SharedInfrastructure/Build/master)](https://github.com/SixLabors/SharedInfrastructure/actions)
|
||||
[![Code coverage](https://codecov.io/gh/SixLabors/SharedInfrastructure/branch/master/graph/badge.svg)](https://codecov.io/gh/SixLabors/SharedInfrastructure)
|
||||
[![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
|
||||
|
||||
</div>
|
||||
|
||||
This repository contains:
|
||||
- Configuration and guidelines for automated linting of C# projects.
|
||||
- Standardized internal C# utility classes to be reused across SixLabors projects (like `Guard`, `MathF`, and `HashCode`)
|
||||
|
@ -143,31 +151,63 @@ An up-to-date list of which StyleCop rules are implemented and which have code f
|
|||
To include internals like `Guard.cs`, `MathF`, and `HashCode` into your project you should add configuration like the following to your `.csproj`:
|
||||
|
||||
``` xml
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_RUNTIME_INTRINSICS;SUPPORTS_CODECOVERAGE;SUPPORTS_HOTPATH</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<!--
|
||||
https://apisof.net/
|
||||
+===================+=======+==========+=====================+=============+=================+====================+==============+=========+============|
|
||||
| SUPPORTS | MATHF | HASHCODE | EXTENDED_INTRINSICS | SPAN_STREAM | ENCODING_STRING | RUNTIME_INTRINSICS | CODECOVERAGE | HOTPATH | CREATESPAN |
|
||||
+===================+=======+==========+=====================+=============+=================+====================+==============+=========|============|
|
||||
| netcoreapp3.1 | Y | Y | Y | Y | Y | Y | Y | Y | Y |
|
||||
| netcoreapp2.1 | Y | Y | Y | Y | Y | N | Y | N | Y |
|
||||
| netcoreapp2.0 | Y | N | N | N | N | N | Y | N | Y |
|
||||
| netstandard2.1 | Y | Y | N | Y | Y | N | Y | N | Y |
|
||||
| netstandard2.0 | N | N | N | N | N | N | Y | N | N |
|
||||
| netstandard1.3 | N | N | N | N | N | N | N | N | N |
|
||||
| net472 | N | N | Y | N | N | N | Y | N | N |
|
||||
+===================+=======+==========+=====================+=============+=================+====================+==============+=========|============|
|
||||
-->
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_HASHCODE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_SPAN_STREAM</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_ENCODING_STRING</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_RUNTIME_INTRINSICS</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_HOTPATH</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CREATESPAN</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_HASHCODE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_SPAN_STREAM</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_ENCODING_STRING</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CREATESPAN</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CREATESPAN</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_HASHCODE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_SPAN_STREAM</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_ENCODING_STRING</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CREATESPAN</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
```
|
||||
|
||||
And add the `SharedInfrastructure.shproj` as a project dependency.
|
||||
|
||||
*Note:* This might change as soon as we include shared msbuild infrastructure elements (`.props` and `.targets`)
|
||||
*Note:* This might change as soon as we include shared msbuild infrastructure elements (`.props` and `.targets`)
|
||||
|
|
|
@ -7,11 +7,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharedInfrastructure.Tests"
|
|||
EndProject
|
||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SharedInfrastructure", "src\SharedInfrastructure\SharedInfrastructure.shproj", "{68A8CC40-6AED-4E96-B524-31B1158FDEEA}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{27502888-A75B-4BCB-8D19-C81198AEF7C7}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_root", "_root", "{27502888-A75B-4BCB-8D19-C81198AEF7C7}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
.gitattributes = .gitattributes
|
||||
.gitignore = .gitignore
|
||||
ci-build.ps1 = ci-build.ps1
|
||||
ci-test.ps1 = ci-test.ps1
|
||||
codecov.yml = codecov.yml
|
||||
LICENSE = LICENSE
|
||||
README.md = README.md
|
||||
SixLabors.ruleset = SixLabors.ruleset
|
||||
|
@ -20,6 +23,24 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||
stylecop.json = stylecop.json
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{91A98DCB-FA23-444B-865A-3734578F1C28}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.github\FUNDING.yml = .github\FUNDING.yml
|
||||
.github\PULL_REQUEST_TEMPLATE.md = .github\PULL_REQUEST_TEMPLATE.md
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{B3C84CC9-D0F5-4D9F-93A8-D742A73F3674}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{07706BC0-CA04-4558-A005-3F9FA7D9933C}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{478B60EE-3651-4B39-83BD-528C428AC628}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
tests\coverlet.runsettings = tests\coverlet.runsettings
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||
src\SharedInfrastructure\SharedInfrastructure.projitems*{1664b46a-d99f-4c66-9424-a3a17c926a4c}*SharedItemsImports = 5
|
||||
|
@ -38,6 +59,12 @@ Global
|
|||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{1664B46A-D99F-4C66-9424-A3A17C926A4C} = {478B60EE-3651-4B39-83BD-528C428AC628}
|
||||
{68A8CC40-6AED-4E96-B524-31B1158FDEEA} = {07706BC0-CA04-4558-A005-3F9FA7D9933C}
|
||||
{91A98DCB-FA23-444B-865A-3734578F1C28} = {27502888-A75B-4BCB-8D19-C81198AEF7C7}
|
||||
{B3C84CC9-D0F5-4D9F-93A8-D742A73F3674} = {91A98DCB-FA23-444B-865A-3734578F1C28}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {CDD6BE8E-01A1-4A70-AA7E-F1D64E8FA829}
|
||||
EndGlobalSection
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
param(
|
||||
[Parameter(Mandatory = $true, Position = 0)]
|
||||
[string]$targetFramework
|
||||
)
|
||||
|
||||
dotnet clean -c Release
|
||||
|
||||
$repositoryUrl = "https://github.com/$env:GITHUB_REPOSITORY"
|
||||
|
||||
# Building for a specific framework.
|
||||
dotnet build -c Release -f $targetFramework /p:RepositoryUrl=$repositoryUrl
|
|
@ -0,0 +1,37 @@
|
|||
param(
|
||||
[Parameter(Mandatory, Position = 0)]
|
||||
[string]$os,
|
||||
[Parameter(Mandatory, Position = 1)]
|
||||
[string]$targetFramework,
|
||||
[Parameter(Mandatory, Position = 2)]
|
||||
[string]$platform,
|
||||
[Parameter(Mandatory, Position = 3)]
|
||||
[string]$codecov,
|
||||
[Parameter(Position = 4)]
|
||||
[string]$codecovProfile = 'Release'
|
||||
)
|
||||
|
||||
$netFxRegex = '^net\d+'
|
||||
|
||||
if ($codecov -eq 'true') {
|
||||
|
||||
# Allow toggling of profile to workaround any potential JIT errors caused by code injection.
|
||||
dotnet clean -c $codecovProfile
|
||||
dotnet test --collect "XPlat Code Coverage" --settings .\tests\coverlet.runsettings -c $codecovProfile -f $targetFramework /p:CodeCov=true
|
||||
}
|
||||
elseif ($platform -eq '-x86' -and $targetFramework -match $netFxRegex) {
|
||||
|
||||
# xunit doesn't run on core with NET SDK 3.1+.
|
||||
# xunit doesn't actually understand -x64 as an option.
|
||||
#
|
||||
# xunit requires explicit path.
|
||||
Set-Location $env:XUNIT_PATH
|
||||
|
||||
dotnet xunit --no-build -c Release -f $targetFramework ${fxVersion} $platform
|
||||
|
||||
Set-Location $PSScriptRoot
|
||||
}
|
||||
else {
|
||||
|
||||
dotnet test --no-build -c Release -f $targetFramework
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
# Documentation: https://docs.codecov.io/docs/codecov-yaml
|
||||
|
||||
codecov:
|
||||
# Avoid "Missing base report"
|
||||
# https://github.com/codecov/support/issues/363
|
||||
# https://docs.codecov.io/docs/comparing-commits
|
||||
allow_coverage_offsets: true
|
||||
|
||||
# Avoid Report Expired
|
||||
# https://docs.codecov.io/docs/codecov-yaml#section-expired-reports
|
||||
max_report_age: off
|
|
@ -9,9 +9,10 @@ using System.Collections.Generic;
|
|||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using SixLabors;
|
||||
using Xunit;
|
||||
|
||||
namespace SixLabors
|
||||
namespace SharedInfrastructure.Tests
|
||||
{
|
||||
public class DebugGuardTests
|
||||
{
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the Apache License, Version 2.0.
|
||||
|
||||
using System;
|
||||
using SixLabors;
|
||||
using Xunit;
|
||||
|
||||
namespace SixLabors
|
||||
namespace SharedInfrastructure.Tests
|
||||
{
|
||||
public class GuardTests
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
using System;
|
||||
using Xunit;
|
||||
|
||||
namespace SixLabors
|
||||
namespace SharedInfrastructure.Tests
|
||||
{
|
||||
public class MathFTests
|
||||
{
|
||||
|
|
|
@ -2,60 +2,94 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1;netcoreapp2.0;net472;net46</TargetFrameworks>
|
||||
<AssemblyName>SixLabors</AssemblyName>
|
||||
<RootNamespace>SixLabors</RootNamespace>
|
||||
<AssemblyName>SharedInfrastructure.Tests</AssemblyName>
|
||||
<RootNamespace>SharedInfrastructure.Tests</RootNamespace>
|
||||
<IsPackable>false</IsPackable>
|
||||
<CodeAnalysisRuleSet>..\..\SixLabors.Tests.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
|
||||
<!--
|
||||
https://apisof.net/
|
||||
+===================+=======+==========+=====================+=============+=================+====================+==============+=========|
|
||||
| SUPPORTS | MATHF | HASHCODE | EXTENDED_INTRINSICS | SPAN_STREAM | ENCODING_STRING | RUNTIME_INTRINSICS | CODECOVERAGE | HOTPATH |
|
||||
+===================+=======+==========+=====================+=============+=================+====================+==============+=========|
|
||||
| netcoreapp3.1 | Y | Y | Y | Y | Y | Y | Y | Y |
|
||||
| netcoreapp2.1 | Y | Y | Y | Y | Y | N | Y | N |
|
||||
| netcoreapp2.0 | Y | N | N | N | N | N | Y | N |
|
||||
| netstandard2.1 | Y | Y | N | Y | Y | N | Y | N |
|
||||
| netstandard2.0 | N | N | N | N | N | N | Y | N |
|
||||
| netstandard1.3 | N | N | N | N | N | N | N | N |
|
||||
| net472 | N | N | Y | N | N | N | Y | N |
|
||||
+===================+=======+==========+=====================+=============+=================+====================+==============+=========|
|
||||
+===================+=======+==========+=====================+=============+=================+====================+==============+=========+============|
|
||||
| SUPPORTS | MATHF | HASHCODE | EXTENDED_INTRINSICS | SPAN_STREAM | ENCODING_STRING | RUNTIME_INTRINSICS | CODECOVERAGE | HOTPATH | CREATESPAN |
|
||||
+===================+=======+==========+=====================+=============+=================+====================+==============+=========|============|
|
||||
| netcoreapp3.1 | Y | Y | Y | Y | Y | Y | Y | Y | Y |
|
||||
| netcoreapp2.1 | Y | Y | Y | Y | Y | N | Y | N | Y |
|
||||
| netcoreapp2.0 | Y | N | N | N | N | N | Y | N | Y |
|
||||
| netstandard2.1 | Y | Y | N | Y | Y | N | Y | N | Y |
|
||||
| netstandard2.0 | N | N | N | N | N | N | Y | N | N |
|
||||
| netstandard1.3 | N | N | N | N | N | N | N | N | N |
|
||||
| net472 | N | N | Y | N | N | N | Y | N | N |
|
||||
+===================+=======+==========+=====================+=============+=================+====================+==============+=========|============|
|
||||
-->
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_RUNTIME_INTRINSICS;SUPPORTS_CODECOVERAGE;SUPPORTS_HOTPATH</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_HASHCODE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_SPAN_STREAM</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_ENCODING_STRING</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_RUNTIME_INTRINSICS</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_HOTPATH</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CREATESPAN</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_HASHCODE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_SPAN_STREAM</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_ENCODING_STRING</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CREATESPAN</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CREATESPAN</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;SUPPORTS_HASHCODE;SUPPORTS_SPAN_STREAM;SUPPORTS_ENCODING_STRING;SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_HASHCODE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_SPAN_STREAM</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_ENCODING_STRING</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CREATESPAN</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS;SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS</DefineConstants>
|
||||
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!--dotnet tools does not have an x86 runner. You have to use separate SDKs-->
|
||||
<!--https://github.com/actions/setup-dotnet/issues/72-->
|
||||
<DotNetCliToolReference Update="dotnet-xunit" Version="2.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
|
||||
<!--Don't update the SDK. It causes xunit to break for netcore 2.0-->
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp2.0' ">
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="1.3.0" PrivateAssets="All"/>
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Buffers" Version="4.5.0" />
|
||||
<PackageReference Include="System.Memory" Version="4.5.3" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
|
||||
<PackageReference Include="coverlet.collector" Version="1.2.0" />
|
||||
|
||||
<AdditionalFiles Include="..\..\stylecop.json" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<RunSettings>
|
||||
<DataCollectionRunSettings>
|
||||
<DataCollectors>
|
||||
<DataCollector friendlyName="XPlat code coverage">
|
||||
<Configuration>
|
||||
<Format>lcov</Format>
|
||||
<Include>[SixLabors.*]*,[System.*]*</Include>
|
||||
<UseSourceLink>true</UseSourceLink>
|
||||
</Configuration>
|
||||
</DataCollector>
|
||||
</DataCollectors>
|
||||
</DataCollectionRunSettings>
|
||||
</RunSettings>
|
Загрузка…
Ссылка в новой задаче