From 9b3c53caba0da990eb52286e42b94885598da754 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 19 Jan 2020 23:20:48 +1100 Subject: [PATCH 1/6] Fixed Python coverage on macOS and Ubuntu GHA --- .ci/after_success.sh | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.ci/after_success.sh b/.ci/after_success.sh index 55e14f958..63f59d5cd 100755 --- a/.ci/after_success.sh +++ b/.ci/after_success.sh @@ -1,18 +1,8 @@ #!/bin/bash # gather the coverage data -if [[ "$MATRIX_OS" == "macOS-latest" ]]; then - brew install lcov -else - sudo apt-get -qq install lcov -fi - -lcov --capture --directory . -b . --output-file coverage.info -# filter to remove system headers -lcov --remove coverage.info '/usr/*' -o coverage.filtered.info - pip install codecov -coverage report +coverage xml if [[ $TRAVIS ]]; then codecov From d694bdfc0bf7378eff4564f7ef233fb378e5aab1 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 19 Jan 2020 23:45:41 +1100 Subject: [PATCH 2/6] Fixed Python coverage on Windows GHA --- .github/workflows/test-windows.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index ff438e37c..229de6c07 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -364,6 +364,13 @@ jobs: name: errors path: Tests/errors + - name: After success + if: success() + run: | + .ci/after_success.sh + env: + MATRIX_OS: ${{ matrix.os }} + - name: Prepare coverage token if: success() && github.repository == 'python-pillow/Pillow' run: cp .github/codecov-upstream.yml .codecov.yml @@ -373,6 +380,7 @@ jobs: uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml name: ${{ runner.os }} Python ${{ matrix.python-version }} - name: Build wheel From 6101a5d7e8bc74d33376da173ef13cc65ad12a10 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 19 Jan 2020 23:57:27 +1100 Subject: [PATCH 3/6] Removed prefix dot from codecov.yml --- .github/workflows/test-docker.yml | 2 +- .github/workflows/test-windows.yml | 2 +- .github/workflows/test.yml | 2 +- MANIFEST.in | 2 +- .codecov.yml => codecov.yml | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename .codecov.yml => codecov.yml (100%) diff --git a/.github/workflows/test-docker.yml b/.github/workflows/test-docker.yml index 4843a9c0a..2634d3d4f 100644 --- a/.github/workflows/test-docker.yml +++ b/.github/workflows/test-docker.yml @@ -54,7 +54,7 @@ jobs: - name: Prepare coverage token if: success() && github.repository == 'python-pillow/Pillow' - run: cp .github/codecov-upstream.yml .codecov.yml + run: cp .github/codecov-upstream.yml codecov.yml - name: Upload coverage if: success() diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 229de6c07..bbfb00fdb 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -373,7 +373,7 @@ jobs: - name: Prepare coverage token if: success() && github.repository == 'python-pillow/Pillow' - run: cp .github/codecov-upstream.yml .codecov.yml + run: cp .github/codecov-upstream.yml codecov.yml - name: Upload coverage if: success() diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2ef5f8fb0..e467ceedd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -92,7 +92,7 @@ jobs: - name: Prepare coverage token if: success() && github.repository == 'python-pillow/Pillow' - run: cp .github/codecov-upstream.yml .codecov.yml + run: cp .github/codecov-upstream.yml codecov.yml - name: Upload coverage if: success() diff --git a/MANIFEST.in b/MANIFEST.in index 178bf477e..47daf4a11 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -18,10 +18,10 @@ graft docs # build/src control detritus exclude .appveyor.yml exclude .coveragerc -exclude .codecov.yml exclude .editorconfig exclude .readthedocs.yml exclude azure-pipelines.yml +exclude codecov.yml global-exclude .git* global-exclude *.pyc global-exclude *.so diff --git a/.codecov.yml b/codecov.yml similarity index 100% rename from .codecov.yml rename to codecov.yml From 1d0c63e5231a484f6eda3029522fd62a7f7b15a0 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 20 Jan 2020 06:20:13 +1100 Subject: [PATCH 4/6] Specify shell --- .github/workflows/test-windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index bbfb00fdb..98b098a0d 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -370,6 +370,7 @@ jobs: .ci/after_success.sh env: MATRIX_OS: ${{ matrix.os }} + shell: pwsh - name: Prepare coverage token if: success() && github.repository == 'python-pillow/Pillow' From 04262913a28a455f3facbeee52b4147afcc894b3 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 20 Jan 2020 06:21:19 +1100 Subject: [PATCH 5/6] MATRIX_OS no longer needed --- .github/workflows/test-windows.yml | 2 -- .github/workflows/test.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 98b098a0d..7ef573864 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -368,8 +368,6 @@ jobs: if: success() run: | .ci/after_success.sh - env: - MATRIX_OS: ${{ matrix.os }} shell: pwsh - name: Prepare coverage token diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e467ceedd..3812c4d4c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -87,8 +87,6 @@ jobs: if: success() run: | .ci/after_success.sh - env: - MATRIX_OS: ${{ matrix.os }} - name: Prepare coverage token if: success() && github.repository == 'python-pillow/Pillow' From 6eed4838200f5672de4eb9e23f644db0df1440bb Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 24 Jan 2020 22:36:49 +1100 Subject: [PATCH 6/6] Fixed Python coverage on Docker GHA --- .ci/after_success.sh | 8 ++++++-- .github/workflows/test-docker.yml | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.ci/after_success.sh b/.ci/after_success.sh index 63f59d5cd..5f418f114 100755 --- a/.ci/after_success.sh +++ b/.ci/after_success.sh @@ -1,8 +1,12 @@ #!/bin/bash # gather the coverage data -pip install codecov -coverage xml +pip3 install codecov +if [[ $MATRIX_DOCKER ]]; then + coverage xml --ignore-errors +else + coverage xml +fi if [[ $TRAVIS ]]; then codecov diff --git a/.github/workflows/test-docker.yml b/.github/workflows/test-docker.yml index 2634d3d4f..c078e5d00 100644 --- a/.github/workflows/test-docker.yml +++ b/.github/workflows/test-docker.yml @@ -41,16 +41,21 @@ jobs: run: | # The Pillow user in the docker container is UID 1000 sudo chown -R 1000 $GITHUB_WORKSPACE - docker run -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }} + docker run --name pillow_container -v $GITHUB_WORKSPACE:/Pillow pythonpillow/${{ matrix.docker }}:${{ matrix.dockerTag }} sudo chown -R runner $GITHUB_WORKSPACE - name: After success if: success() run: | PATH="$PATH:~/.local/bin" + docker start pillow_container + pil_path=`docker exec pillow_container /vpy3/bin/python -c 'import os, PIL;print(os.path.realpath(os.path.dirname(PIL.__file__)))'` + docker stop pillow_container + sudo mkdir -p $pil_path + sudo cp src/PIL/*.py $pil_path .ci/after_success.sh env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + MATRIX_DOCKER: ${{ matrix.docker }} - name: Prepare coverage token if: success() && github.repository == 'python-pillow/Pillow'