From 77ad951d9604ce975751a3767a5e0b4f4106f052 Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 12 Dec 2019 00:07:00 +0200 Subject: [PATCH 1/5] GHA: Use python-pillow/Pillow's Codecov token for own builds --- .codecov.yml | 2 -- .github/workflows/codecov-upstream.yml | 18 ++++++++++++++++++ .github/workflows/test-windows.yml | 14 ++++++++++---- .github/workflows/test.yml | 14 +++++++++----- 4 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/codecov-upstream.yml diff --git a/.codecov.yml b/.codecov.yml index 060b2685e..a9ab1c2d7 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -6,8 +6,6 @@ codecov: # https://docs.codecov.io/docs/comparing-commits allow_coverage_offsets: true - token: 6dafc396-e7f5-4221-a38a-8b07a49fbdae - comment: off # Matches 'omit:' in .coveragerc diff --git a/.github/workflows/codecov-upstream.yml b/.github/workflows/codecov-upstream.yml new file mode 100644 index 000000000..d348345dc --- /dev/null +++ b/.github/workflows/codecov-upstream.yml @@ -0,0 +1,18 @@ +# Documentation: https://docs.codecov.io/docs/codecov-yaml + +codecov: + # Avoid "Missing base report" due to committing CHANGES.rst with "[CI skip]" + # https://github.com/codecov/support/issues/363 + # https://docs.codecov.io/v4.3.6/docs/comparing-commits + allow_coverage_offsets: true + + token: 6dafc396-e7f5-4221-a38a-8b07a49fbdae + +comment: off + +# Matches 'omit:' in .coveragerc +ignore: + - "Tests/32bit_segfault_check.py" + - "Tests/bench_cffi_access.py" + - "Tests/check_*.py" + - "Tests/createfontdatachunk.py" diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index e0c55bc1a..fc97df3f3 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -366,10 +366,16 @@ jobs: - name: Upload coverage if: success() - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - name: ${{ runner.os }} Python ${{ matrix.python-version }} + run: | + if [ "$GITHUB_REPOSITORY" == "python-pillow/Pillow" ]; then + echo "CI on python-pillow/Pillow, copy CodeCov settings" + cp .github/workflows/codecov-upstream.yml .codecov.yml + fi + curl -s https://codecov.io/bash | bash + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + CODECOV_NAME: ${{ runner.os }} Python ${{ matrix.python-version }} + shell: bash - name: Build wheel id: wheel diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 78307b7a1..4419adad4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -95,12 +95,16 @@ jobs: .travis/after_success.sh env: MATRIX_OS: ${{ matrix.os }} - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - name: Upload coverage if: success() - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - name: ${{ matrix.os }} Python ${{ matrix.python-version }} + run: | + if [ "$GITHUB_REPOSITORY" == "python-pillow/Pillow" ]; then + echo "CI on python-pillow/Pillow, copy CodeCov settings" + cp .github/workflows/codecov-upstream.yml .codecov.yml + fi + bash <(curl -s https://codecov.io/bash) + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + CODECOV_NAME: ${{ matrix.os }} Python ${{ matrix.python-version }} From 1c90c9d541211f287380e206cc207ebf100d91b0 Mon Sep 17 00:00:00 2001 From: Hugo Date: Sat, 14 Dec 2019 13:42:54 +0200 Subject: [PATCH 2/5] Add echo to debug 'Windows / Python 3.5 x86' --- .github/workflows/test-windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index fc97df3f3..a49679a4f 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -371,7 +371,8 @@ jobs: echo "CI on python-pillow/Pillow, copy CodeCov settings" cp .github/workflows/codecov-upstream.yml .codecov.yml fi - curl -s https://codecov.io/bash | bash + echo Upload coverage + curl -s https://codecov.io/bash | bash env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} CODECOV_NAME: ${{ runner.os }} Python ${{ matrix.python-version }} From eced5620125d1cbafb9fdedc5a318220f3e5a323 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sat, 21 Dec 2019 12:24:45 +0200 Subject: [PATCH 3/5] Fix 404 Co-Authored-By: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- .github/workflows/codecov-upstream.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codecov-upstream.yml b/.github/workflows/codecov-upstream.yml index d348345dc..060b2685e 100644 --- a/.github/workflows/codecov-upstream.yml +++ b/.github/workflows/codecov-upstream.yml @@ -3,7 +3,7 @@ codecov: # Avoid "Missing base report" due to committing CHANGES.rst with "[CI skip]" # https://github.com/codecov/support/issues/363 - # https://docs.codecov.io/v4.3.6/docs/comparing-commits + # https://docs.codecov.io/docs/comparing-commits allow_coverage_offsets: true token: 6dafc396-e7f5-4221-a38a-8b07a49fbdae From 1e5c2564b1b7a86efe9d60ed75db3eb6dc4b7f2f Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 24 Dec 2019 09:58:25 +0200 Subject: [PATCH 4/5] Move codecov config up a dir to prevent GHA recognising as workflow --- .github/{workflows => }/codecov-upstream.yml | 0 .github/workflows/test-windows.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename .github/{workflows => }/codecov-upstream.yml (100%) diff --git a/.github/workflows/codecov-upstream.yml b/.github/codecov-upstream.yml similarity index 100% rename from .github/workflows/codecov-upstream.yml rename to .github/codecov-upstream.yml diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index a49679a4f..0f05d7b1c 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -369,7 +369,7 @@ jobs: run: | if [ "$GITHUB_REPOSITORY" == "python-pillow/Pillow" ]; then echo "CI on python-pillow/Pillow, copy CodeCov settings" - cp .github/workflows/codecov-upstream.yml .codecov.yml + cp .github/codecov-upstream.yml .codecov.yml fi echo Upload coverage curl -s https://codecov.io/bash | bash diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4419adad4..f98763e85 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -102,7 +102,7 @@ jobs: run: | if [ "$GITHUB_REPOSITORY" == "python-pillow/Pillow" ]; then echo "CI on python-pillow/Pillow, copy CodeCov settings" - cp .github/workflows/codecov-upstream.yml .codecov.yml + cp .github/codecov-upstream.yml .codecov.yml fi bash <(curl -s https://codecov.io/bash) env: From 22ac95a588d49bb4e8a83d5f3db76c2738bdc0a6 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 24 Dec 2019 19:11:46 +1100 Subject: [PATCH 5/5] Keep codecov-action --- .github/workflows/test-windows.yml | 19 ++++++++----------- .github/workflows/test.yml | 17 ++++++++--------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 0f05d7b1c..e97db30c4 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -364,19 +364,16 @@ jobs: name: errors path: Tests/errors + - name: Prepare coverage token + if: success() && github.repository == 'python-pillow/Pillow' + run: cp .github/codecov-upstream.yml .codecov.yml + - name: Upload coverage if: success() - run: | - if [ "$GITHUB_REPOSITORY" == "python-pillow/Pillow" ]; then - echo "CI on python-pillow/Pillow, copy CodeCov settings" - cp .github/codecov-upstream.yml .codecov.yml - fi - echo Upload coverage - curl -s https://codecov.io/bash | bash - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - CODECOV_NAME: ${{ runner.os }} Python ${{ matrix.python-version }} - shell: bash + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + name: ${{ runner.os }} Python ${{ matrix.python-version }} - name: Build wheel id: wheel diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f98763e85..94836fb52 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -97,14 +97,13 @@ jobs: MATRIX_OS: ${{ matrix.os }} COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + - name: Prepare coverage token + if: success() && github.repository == 'python-pillow/Pillow' + run: cp .github/codecov-upstream.yml .codecov.yml + - name: Upload coverage if: success() - run: | - if [ "$GITHUB_REPOSITORY" == "python-pillow/Pillow" ]; then - echo "CI on python-pillow/Pillow, copy CodeCov settings" - cp .github/codecov-upstream.yml .codecov.yml - fi - bash <(curl -s https://codecov.io/bash) - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - CODECOV_NAME: ${{ matrix.os }} Python ${{ matrix.python-version }} + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + name: ${{ matrix.os }} Python ${{ matrix.python-version }}