36
.gitlab/pytest.gitlab-ci.yml
Normal file
36
.gitlab/pytest.gitlab-ci.yml
Normal file
@ -0,0 +1,36 @@
|
||||
|
||||
|
||||
Unit:
|
||||
stage: test
|
||||
image: python:3.11-alpine3.19
|
||||
needs: []
|
||||
script:
|
||||
- pip install -r requirements.txt
|
||||
- pip install -r requirements_test.txt
|
||||
- cd itsm
|
||||
- pytest --cov --cov-report term --cov-report xml:../artifacts/coverage.xml --cov-report html:../artifacts/coverage/ --junit-xml=../artifacts/test.junit.xml
|
||||
artifacts:
|
||||
expire_in: "30 days"
|
||||
when: always
|
||||
reports:
|
||||
coverage_report:
|
||||
coverage_format: cobertura
|
||||
path: artifacts/coverage.xml
|
||||
junit:
|
||||
- artifacts/unit.JUnit.xml
|
||||
paths:
|
||||
- artifacts/
|
||||
rules:
|
||||
|
||||
- if: # Occur on merge
|
||||
$CI_COMMIT_BRANCH
|
||||
&&
|
||||
(
|
||||
$CI_PIPELINE_SOURCE == "push"
|
||||
||
|
||||
$CI_PIPELINE_SOURCE == "web"
|
||||
)
|
||||
when: always
|
||||
|
||||
- when: never
|
||||
|
Reference in New Issue
Block a user