From 77ad951d9604ce975751a3767a5e0b4f4106f052 Mon Sep 17 00:00:00 2001 From: Hugo Date: Thu, 12 Dec 2019 00:07:00 +0200 Subject: [PATCH] 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 }}