mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 10:26:19 +03:00
Merge pull request #4371 from radarhere/coverage
Fixed Python coverage on GitHub Actions
This commit is contained in:
commit
d33d467169
|
@ -1,19 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# gather the coverage data
|
# gather the coverage data
|
||||||
if [[ "$MATRIX_OS" == "macOS-latest" ]]; then
|
pip3 install codecov
|
||||||
brew install lcov
|
if [[ $MATRIX_DOCKER ]]; then
|
||||||
|
coverage xml --ignore-errors
|
||||||
else
|
else
|
||||||
sudo apt-get -qq install lcov
|
coverage xml
|
||||||
fi
|
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
|
|
||||||
|
|
||||||
if [[ $TRAVIS ]]; then
|
if [[ $TRAVIS ]]; then
|
||||||
codecov
|
codecov
|
||||||
fi
|
fi
|
||||||
|
|
11
.github/workflows/test-docker.yml
vendored
11
.github/workflows/test-docker.yml
vendored
|
@ -41,20 +41,25 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
# The Pillow user in the docker container is UID 1000
|
# The Pillow user in the docker container is UID 1000
|
||||||
sudo chown -R 1000 $GITHUB_WORKSPACE
|
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
|
sudo chown -R runner $GITHUB_WORKSPACE
|
||||||
|
|
||||||
- name: After success
|
- name: After success
|
||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
PATH="$PATH:~/.local/bin"
|
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
|
.ci/after_success.sh
|
||||||
env:
|
env:
|
||||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
MATRIX_DOCKER: ${{ matrix.docker }}
|
||||||
|
|
||||||
- name: Prepare coverage token
|
- name: Prepare coverage token
|
||||||
if: success() && github.repository == 'python-pillow/Pillow'
|
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
|
- name: Upload coverage
|
||||||
if: success()
|
if: success()
|
||||||
|
|
9
.github/workflows/test-windows.yml
vendored
9
.github/workflows/test-windows.yml
vendored
|
@ -364,15 +364,22 @@ jobs:
|
||||||
name: errors
|
name: errors
|
||||||
path: Tests/errors
|
path: Tests/errors
|
||||||
|
|
||||||
|
- name: After success
|
||||||
|
if: success()
|
||||||
|
run: |
|
||||||
|
.ci/after_success.sh
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
- name: Prepare coverage token
|
- name: Prepare coverage token
|
||||||
if: success() && github.repository == 'python-pillow/Pillow'
|
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
|
- name: Upload coverage
|
||||||
if: success()
|
if: success()
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
file: ./coverage.xml
|
||||||
name: ${{ runner.os }} Python ${{ matrix.python-version }}
|
name: ${{ runner.os }} Python ${{ matrix.python-version }}
|
||||||
|
|
||||||
- name: Build wheel
|
- name: Build wheel
|
||||||
|
|
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
@ -87,12 +87,10 @@ jobs:
|
||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
.ci/after_success.sh
|
.ci/after_success.sh
|
||||||
env:
|
|
||||||
MATRIX_OS: ${{ matrix.os }}
|
|
||||||
|
|
||||||
- name: Prepare coverage token
|
- name: Prepare coverage token
|
||||||
if: success() && github.repository == 'python-pillow/Pillow'
|
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
|
- name: Upload coverage
|
||||||
if: success()
|
if: success()
|
||||||
|
|
|
@ -18,10 +18,10 @@ graft docs
|
||||||
# build/src control detritus
|
# build/src control detritus
|
||||||
exclude .appveyor.yml
|
exclude .appveyor.yml
|
||||||
exclude .coveragerc
|
exclude .coveragerc
|
||||||
exclude .codecov.yml
|
|
||||||
exclude .editorconfig
|
exclude .editorconfig
|
||||||
exclude .readthedocs.yml
|
exclude .readthedocs.yml
|
||||||
exclude azure-pipelines.yml
|
exclude azure-pipelines.yml
|
||||||
|
exclude codecov.yml
|
||||||
global-exclude .git*
|
global-exclude .git*
|
||||||
global-exclude *.pyc
|
global-exclude *.pyc
|
||||||
global-exclude *.so
|
global-exclude *.so
|
||||||
|
|
Loading…
Reference in New Issue
Block a user