mirror of
				https://gitea.publichub.eu/oscar.krause/fastapi-dls.git
				synced 2025-11-04 03:16:07 +00:00 
			
		
		
		
	added code-quality and test-coverage
This commit is contained in:
		@@ -1,3 +1,6 @@
 | 
				
			|||||||
 | 
					include:
 | 
				
			||||||
 | 
					  - template: Jobs/Code-Quality.gitlab-ci.yml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cache:
 | 
					cache:
 | 
				
			||||||
  key: one-key-to-rule-them-all
 | 
					  key: one-key-to-rule-them-all
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -179,6 +182,30 @@ test:archlinux:
 | 
				
			|||||||
    - pacman -Sy
 | 
					    - pacman -Sy
 | 
				
			||||||
    - pacman -U --noconfirm *.pkg.tar.zst
 | 
					    - pacman -U --noconfirm *.pkg.tar.zst
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					code_quality:
 | 
				
			||||||
 | 
					  rules:
 | 
				
			||||||
 | 
					    - if: $CODE_QUALITY_DISABLED
 | 
				
			||||||
 | 
					      when: never
 | 
				
			||||||
 | 
					    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
 | 
				
			||||||
 | 
					    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test_coverage:
 | 
				
			||||||
 | 
					  extends: test
 | 
				
			||||||
 | 
					  rules:
 | 
				
			||||||
 | 
					    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
 | 
				
			||||||
 | 
					    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
 | 
				
			||||||
 | 
					  script:
 | 
				
			||||||
 | 
					    - pip install pytest pytest-cov
 | 
				
			||||||
 | 
					    - coverage run -m pytest
 | 
				
			||||||
 | 
					    - coverage report
 | 
				
			||||||
 | 
					    - coverage xml
 | 
				
			||||||
 | 
					  coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
 | 
				
			||||||
 | 
					  artifacts:
 | 
				
			||||||
 | 
					    reports:
 | 
				
			||||||
 | 
					      coverage_report:
 | 
				
			||||||
 | 
					        coverage_format: cobertura
 | 
				
			||||||
 | 
					        path: '**/coverage.xml'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.deploy:
 | 
					.deploy:
 | 
				
			||||||
  rules:
 | 
					  rules:
 | 
				
			||||||
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
 | 
					    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user