From dfe882d9484efe95912310efdc413eba17422f6d Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Sat, 25 Jan 2020 14:27:53 +0100 Subject: [PATCH 1/4] fix ci --- ci-test.ps1 | 4 ++-- tests/Directory.Build.props | 1 - tests/Directory.Build.targets | 20 ++------------------ tests/coverlet.runsettings | 14 ++++++++++++++ 4 files changed, 18 insertions(+), 21 deletions(-) create mode 100644 tests/coverlet.runsettings diff --git a/ci-test.ps1 b/ci-test.ps1 index 35a9b4646d..d0be1e1a87 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 -configuration $codecovProfile -framework $targetFramework } 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/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 + + + + + From 9847af860b95f0939317fd7b557c59b9ac4d7884 Mon Sep 17 00:00:00 2001 From: Marco Rossignoli Date: Sat, 25 Jan 2020 14:49:17 +0100 Subject: [PATCH 2/4] update ci script --- ci-test.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-test.ps1 b/ci-test.ps1 index d0be1e1a87..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 -collect:"XPlat Code Coverage" -settings .\tests\coverlet.runsettings -configuration $codecovProfile -framework $targetFramework + 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) { From fa340ba664a91c49c69bd3f8ee12a815b0f7241f Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sun, 26 Jan 2020 11:23:35 +1100 Subject: [PATCH 3/4] Workaround codecov for forks. --- .github/codecov-upstream.yml | 12 ++++++++++++ .github/workflows/build-and-test.yml | 7 +++++++ codecov.yml | 7 +++++++ 3 files changed, 26 insertions(+) create mode 100644 .github/codecov-upstream.yml create mode 100644 codecov.yml diff --git a/.github/codecov-upstream.yml b/.github/codecov-upstream.yml new file mode 100644 index 0000000000..b62032bfb0 --- /dev/null +++ b/.github/codecov-upstream.yml @@ -0,0 +1,12 @@ +# 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 "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 + token: 0ef021c7-2679-4012-b42f-4bed33d99450 diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index b4b966a02d..5698f549a3 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -85,6 +85,13 @@ 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: Prepare Codecov Token + if: matrix.options.codecov == true && github.repository == 'SixLabors/ImageSharp' + run: cp .github/codecov-upstream.yml .codecov.yml + - name: Update Codecov uses: iansu/codecov-action-node@v1.0.0 if: matrix.options.codecov == true 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 From 21440b054bda365233e057beced8d26f955bca6d Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sun, 26 Jan 2020 12:14:56 +1100 Subject: [PATCH 4/4] Inline token --- .github/codecov-upstream.yml | 12 ------------ .github/workflows/build-and-test.yml | 8 ++------ 2 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 .github/codecov-upstream.yml diff --git a/.github/codecov-upstream.yml b/.github/codecov-upstream.yml deleted file mode 100644 index b62032bfb0..0000000000 --- a/.github/codecov-upstream.yml +++ /dev/null @@ -1,12 +0,0 @@ -# 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 "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 - token: 0ef021c7-2679-4012-b42f-4bed33d99450 diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 5698f549a3..d76d68c1a5 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -88,15 +88,11 @@ jobs: # 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: Prepare Codecov Token - if: matrix.options.codecov == true && github.repository == 'SixLabors/ImageSharp' - run: cp .github/codecov-upstream.yml .codecov.yml - - 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: