Skip to content

Commit 1a6e27d

Browse files
Fancy build
1 parent f5c0ba3 commit 1a6e27d

3 files changed

Lines changed: 65 additions & 19 deletions

File tree

.github/workflows/dotnet-core.yml

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,55 @@ on:
88

99
jobs:
1010
build:
11+
strategy:
12+
matrix:
13+
dotnet: [ '3.1.x' ]
14+
name: Dotnet ${{ matrix.dotnet }}
1115

1216
runs-on: ubuntu-latest
1317

1418
steps:
15-
- uses: actions/checkout@v2
16-
- name: Setup .NET Core
17-
uses: actions/setup-dotnet@v1
18-
with:
19-
dotnet-version: 3.1.301
20-
- name: Install dependencies
21-
run: dotnet restore
22-
- name: Build
23-
run: dotnet build --configuration Release --no-restore
24-
- name: Test
25-
run: dotnet test --no-restore --verbosity normal
19+
- uses: actions/checkout@v2
20+
- name: Setup .NET Core
21+
uses: actions/setup-dotnet@v1
22+
with:
23+
dotnet-version: ${{matrix.dotnet}}
24+
- name: Install dependencies
25+
run: dotnet restore
26+
- name: Build
27+
run: dotnet build --configuration Release --no-restore
28+
- name: Test
29+
run: dotnet test --no-restore --verbosity normal /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=opencover
30+
31+
- name: Create the package
32+
run: dotnet pack --configuration Release System.Text.Json.Extensions
33+
- uses: actions/upload-artifact@v2
34+
with:
35+
name: Dotnet ${{ matrix.dotnet }}
36+
path: System.Text.Json.Extensions/bin/Release/
37+
if-no-files-found: error
38+
39+
- name: ReportGenerator
40+
uses: danielpalme/ReportGenerator-GitHub-Action@4.5.8
41+
with:
42+
reports: '**/TestResults/coverage.opencover.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
43+
targetdir: 'coveragereport' # REQUIRED # The directory where the generated report should be saved.
44+
reporttypes: 'HtmlInline' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary
45+
verbosity: 'Info' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off
46+
tag: '${{ github.run_number }}_${{ github.run_id }}' # Optional tag or build version.
47+
- uses: actions/upload-artifact@v2
48+
with:
49+
name: Dotnet ${{ matrix.dotnet }} coveragereport
50+
path: coveragereport/
51+
if-no-files-found: error
52+
53+
- name: Setup .NET Core for GPR
54+
uses: actions/setup-dotnet@v1
55+
with:
56+
dotnet-version: ${{matrix.dotnet}}
57+
source-url: https://nuget.pkg.github.com/TheConstructor/index.json
58+
env:
59+
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
60+
- name: Publish the package to GPR
61+
if: success() && github.event_name == 'push' && matrix.dotnet == '3.1.x'
62+
run: dotnet nuget push System.Text.Json.Extensions/bin/Release/

System.Text.Json.Extensions/System.Text.Json.Extensions.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.1</TargetFramework>
5+
<PackageId>System.Text.Json.Extensions</PackageId>
6+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
7+
<IncludeSymbols>true</IncludeSymbols>
8+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
59
</PropertyGroup>
610

711
<ItemGroup>
12+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
813
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
914
<PrivateAssets>all</PrivateAssets>
1015
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

System.Text.Json.ExtensionsTest/System.Text.Json.ExtensionsTest.csproj

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,25 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
5-
5+
<DebugType>full</DebugType>
66
<IsPackable>false</IsPackable>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
11-
<PackageReference Include="Shouldly" Version="3.0.2" />
12-
<PackageReference Include="xunit" Version="2.4.1" />
10+
<PackageReference Include="coverlet.msbuild" Version="2.9.0">
11+
<PrivateAssets>all</PrivateAssets>
12+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
13+
</PackageReference>
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1"/>
15+
<PackageReference Include="Shouldly" Version="3.0.2"/>
16+
<PackageReference Include="xunit" Version="2.4.1"/>
1317
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
14-
<PrivateAssets>all</PrivateAssets>
15-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18+
<PrivateAssets>all</PrivateAssets>
19+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1620
</PackageReference>
1721
<PackageReference Include="coverlet.collector" Version="1.3.0">
18-
<PrivateAssets>all</PrivateAssets>
19-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22+
<PrivateAssets>all</PrivateAssets>
23+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2024
</PackageReference>
2125
</ItemGroup>
2226

0 commit comments

Comments
 (0)