diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
index b4b966a02d..d76d68c1a5 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -85,11 +85,14 @@ jobs:
CI: True
XUNIT_PATH: .\tests\ImageSharp.Tests # Required for xunit
+ # Avoid "Please provide the repository token to upload reports via `-t :repository-token`"
+ # https://community.codecov.io/t/whitelist-github-action-servers-to-upload-without-a-token/491/10
+ # https://github.community/t5/GitHub-Actions/Make-secrets-available-to-builds-of-forks/m-p/42814/highlight/true#M5129
- name: Update Codecov
uses: iansu/codecov-action-node@v1.0.0
- if: matrix.options.codecov == true
+ if: matrix.options.codecov == true && startsWith(github.repository, 'SixLabors')
with:
- token: ${{secrets.CODECOV_TOKEN}}
+ token: 0ef021c7-2679-4012-b42f-4bed33d99450
flags: unittests
Publish:
diff --git a/ci-test.ps1 b/ci-test.ps1
index 35a9b4646d..3915ae4ccd 100644
--- a/ci-test.ps1
+++ b/ci-test.ps1
@@ -17,7 +17,7 @@ if ($codecov -eq 'true') {
# Allow toggling of profile to workaround any potential JIT errors caused by code injection.
dotnet clean -c $codecovProfile
- dotnet test -c $codecovProfile -f $targetFramework /p:codecov=true
+ 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) {
@@ -34,4 +34,4 @@ elseif ($platform -eq '-x86' -and $targetFramework -match $netFxRegex) {
else {
dotnet test --no-build -c Release -f $targetFramework
-}
\ No newline at end of file
+}
diff --git a/codecov.yml b/codecov.yml
new file mode 100644
index 0000000000..3941f7ff9a
--- /dev/null
+++ b/codecov.yml
@@ -0,0 +1,7 @@
+# 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
diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props
index 64f79e3248..07d3332760 100644
--- a/tests/Directory.Build.props
+++ b/tests/Directory.Build.props
@@ -32,7 +32,6 @@
-
diff --git a/tests/Directory.Build.targets b/tests/Directory.Build.targets
index 137a7a0305..bacaaa7093 100644
--- a/tests/Directory.Build.targets
+++ b/tests/Directory.Build.targets
@@ -23,30 +23,14 @@
-
-
-
- true
- true
- [SixLabors.*]*
- lcov
-
- $(MSBuildThisFileDirectory)..\
- $(CoverletOutputPath)$(AssemblyName).$(TargetFramework).lcov
-
-
- true
-
-
-
-
+
-
+
diff --git a/tests/coverlet.runsettings b/tests/coverlet.runsettings
new file mode 100644
index 0000000000..ee408a5f04
--- /dev/null
+++ b/tests/coverlet.runsettings
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ lcov
+ [SixLabors.*]*
+ true
+
+
+
+
+