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
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ jobs:
- os: windows-latest
name: Build & test (Windows)
framework_args:
upload_coverage: false
- os: ubuntu-latest
name: Build & test (Ubuntu)
framework_args:
coverage_args: --collect:"XPlat Code Coverage"
upload_coverage: true
runs-on: ${{ matrix.os }}
permissions:
contents: read
Expand All @@ -41,7 +44,15 @@ jobs:
run: dotnet build ${{ env.SOLUTION }} --configuration Release --no-restore ${{ matrix.framework_args }}

- name: Test
run: dotnet test ${{ env.SOLUTION }} --configuration Release --no-restore --no-build ${{ matrix.framework_args }} --logger "console;verbosity=normal"
run: dotnet test ${{ env.SOLUTION }} --configuration Release --no-restore --no-build ${{ matrix.framework_args }} ${{ matrix.coverage_args }} --logger GitHubActions

- name: Upload coverage to Codecov
if: matrix.upload_coverage
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # https://github.com/codecov/codecov-action/releases/tag/v7.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }} # Needed for protected branches
files: test/**/TestResults/**/coverage.cobertura.xml
fail_ci_if_error: true

pack:
name: Create NuGet package
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ PublishScripts/

# NuGet Packages
*.nupkg
N.png
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=nlog.mailkit&metric=bugs)](https://sonarcloud.io/summary/new_code?id=nlog.mailkit)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=nlog.mailkit&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=nlog.mailkit)
[![](https://sonarcloud.io/api/project_badges/measure?project=nlog.mailkit&metric=code_smells)](https://sonarcloud.io/project/issues?id=nlog.mailkit&resolved=false&types=CODE_SMELL)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=nlog.mailkit&metric=coverage)](https://sonarcloud.io/component_measures?id=nlog.mailkit&metric=coverage)
[![codecov](https://codecov.io/gh/NLog/NLog.MailKit/graph/badge.svg?token=fWDfHRUk46)](https://codecov.io/gh/NLog/NLog.MailKit)

Alternative Mail target for [NLog](https://github.com/NLog/NLog) using [MailKit](https://github.com/jstedfast/MailKit).

Expand Down
59 changes: 0 additions & 59 deletions azure-pipelines.yml

This file was deleted.

10 changes: 10 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage:
range: 60..70
status:
project:
default:
target: 70%
patch:
default:
target: auto
threshold: 1%
8 changes: 8 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<NuGetAudit>true</NuGetAudit>
<NuGetAuditMode>all</NuGetAuditMode>
<NuGetAuditLevel>low</NuGetAuditLevel>
<WarningsAsErrors>$(WarningsAsErrors);NU1900;NU1901;NU1902;NU1903;NU1904</WarningsAsErrors>
</PropertyGroup>
</Project>
4 changes: 2 additions & 2 deletions src/NLog.MailKit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NLog.MailKit.Tests", "..\te
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C5050808-B92D-44C2-9EA4-24E4533325C9}"
ProjectSection(SolutionItems) = preProject
..\azure-pipelines.yml = ..\azure-pipelines.yml
..\.github\workflows\build-and-test.yml = ..\.github\workflows\build-and-test.yml
..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml
..\codecov.yml = ..\codecov.yml
EndProjectSection
EndProject
Global
Expand Down
2 changes: 1 addition & 1 deletion src/NLog.MailKit/NLog.MailKit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ See https://github.com/NLog/NLog.MailKit/releases
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MailKit" Version="4.18.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="10.0.13" Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NLog" Version="6.2.2" />
Expand Down
2 changes: 2 additions & 0 deletions test/NLog.MailKit.Tests/NLog.MailKit.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="10.1.0" PrivateAssets="all" />
<PackageReference Include="GitHubActionsTestLogger" Version="3.0.5" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="SmtpServer" Version="11.1.0" />
<PackageReference Include="xunit" Version="2.9.2" />
Expand Down
Loading