mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
Upload image errors to GitHub Actions (#4135)
Upload image errors to GitHub Actions
This commit is contained in:
commit
4e4bb38cd6
7
.github/workflows/test-windows.yml
vendored
7
.github/workflows/test-windows.yml
vendored
|
@ -349,6 +349,13 @@ jobs:
|
|||
%PYTHON%\python.exe -m pytest -vx --cov PIL --cov-report term --cov-report xml Tests
|
||||
shell: cmd
|
||||
|
||||
- name: Upload errors
|
||||
uses: actions/upload-artifact@v1
|
||||
if: failure()
|
||||
with:
|
||||
name: errors
|
||||
path: Tests/errors
|
||||
|
||||
- name: Upload coverage
|
||||
run: 'codecov --file "%GITHUB_WORKSPACE%\coverage.xml" --name "%pythonLocation%"'
|
||||
shell: cmd
|
||||
|
|
7
.github/workflows/test.yml
vendored
7
.github/workflows/test.yml
vendored
|
@ -53,6 +53,13 @@ jobs:
|
|||
run: |
|
||||
.travis/test.sh
|
||||
|
||||
- name: Upload errors
|
||||
uses: actions/upload-artifact@v1
|
||||
if: failure()
|
||||
with:
|
||||
name: errors
|
||||
path: Tests/errors
|
||||
|
||||
- name: Docs
|
||||
if: matrix.python-version == 3.8
|
||||
run: |
|
||||
|
|
|
@ -24,12 +24,26 @@ if os.environ.get("SHOW_ERRORS", None):
|
|||
HAS_UPLOADER = True
|
||||
|
||||
class test_image_results:
|
||||
@classmethod
|
||||
def upload(self, a, b):
|
||||
@staticmethod
|
||||
def upload(a, b):
|
||||
a.show()
|
||||
b.show()
|
||||
|
||||
|
||||
elif "GITHUB_ACTIONS" in os.environ:
|
||||
HAS_UPLOADER = True
|
||||
|
||||
class test_image_results:
|
||||
@staticmethod
|
||||
def upload(a, b):
|
||||
dir_errors = os.path.join(os.path.dirname(__file__), "errors")
|
||||
os.makedirs(dir_errors, exist_ok=True)
|
||||
tmpdir = tempfile.mkdtemp(dir=dir_errors)
|
||||
a.save(os.path.join(tmpdir, "a.png"))
|
||||
b.save(os.path.join(tmpdir, "b.png"))
|
||||
return tmpdir
|
||||
|
||||
|
||||
else:
|
||||
try:
|
||||
import test_image_results
|
||||
|
|
Loading…
Reference in New Issue
Block a user