mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-30 23:47:27 +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 |         %PYTHON%\python.exe -m pytest -vx --cov PIL --cov-report term --cov-report xml Tests | ||||||
|       shell: cmd |       shell: cmd | ||||||
| 
 | 
 | ||||||
|  |     - name: Upload errors | ||||||
|  |       uses: actions/upload-artifact@v1 | ||||||
|  |       if: failure() | ||||||
|  |       with: | ||||||
|  |         name: errors | ||||||
|  |         path: Tests/errors | ||||||
|  | 
 | ||||||
|     - name: Upload coverage |     - name: Upload coverage | ||||||
|       run: 'codecov --file "%GITHUB_WORKSPACE%\coverage.xml" --name "%pythonLocation%"' |       run: 'codecov --file "%GITHUB_WORKSPACE%\coverage.xml" --name "%pythonLocation%"' | ||||||
|       shell: cmd |       shell: cmd | ||||||
|  |  | ||||||
							
								
								
									
										7
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							|  | @ -53,6 +53,13 @@ jobs: | ||||||
|       run: | |       run: | | ||||||
|         .travis/test.sh |         .travis/test.sh | ||||||
| 
 | 
 | ||||||
|  |     - name: Upload errors | ||||||
|  |       uses: actions/upload-artifact@v1 | ||||||
|  |       if: failure() | ||||||
|  |       with: | ||||||
|  |         name: errors | ||||||
|  |         path: Tests/errors | ||||||
|  | 
 | ||||||
|     - name: Docs |     - name: Docs | ||||||
|       if: matrix.python-version == 3.8 |       if: matrix.python-version == 3.8 | ||||||
|       run: | |       run: | | ||||||
|  |  | ||||||
|  | @ -24,12 +24,26 @@ if os.environ.get("SHOW_ERRORS", None): | ||||||
|     HAS_UPLOADER = True |     HAS_UPLOADER = True | ||||||
| 
 | 
 | ||||||
|     class test_image_results: |     class test_image_results: | ||||||
|         @classmethod |         @staticmethod | ||||||
|         def upload(self, a, b): |         def upload(a, b): | ||||||
|             a.show() |             a.show() | ||||||
|             b.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: | else: | ||||||
|     try: |     try: | ||||||
|         import test_image_results |         import test_image_results | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user