create gitlab-ci
This commit is contained in:
parent
1c7965b56d
commit
a174211c12
1 changed files with 60 additions and 0 deletions
60
.gitlab-ci.yml
Normal file
60
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,60 @@
|
|||
workflow:
|
||||
rules:
|
||||
- if: $CI_MERGE_REQUEST_IID
|
||||
- if: $CI_COMMIT_TAG
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
|
||||
variables:
|
||||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
|
||||
FF_USE_FASTZIP: "true"
|
||||
|
||||
stages:
|
||||
- install
|
||||
- quality
|
||||
- test
|
||||
- build
|
||||
|
||||
.pip cache template:
|
||||
cache:
|
||||
key:
|
||||
files:
|
||||
- setup.py
|
||||
paths:
|
||||
- .cache/pip
|
||||
|
||||
requirements:
|
||||
extends: .pip cache template
|
||||
image: python:3.10-alpine
|
||||
stage: install
|
||||
script:
|
||||
- pip install -r requirements.yml
|
||||
cache:
|
||||
policy: pull-push
|
||||
interruptible: true
|
||||
|
||||
linting:
|
||||
extends: .pip cache template
|
||||
image: python:3.10-alpine
|
||||
stage: quality
|
||||
script:
|
||||
- flake8 .
|
||||
cache:
|
||||
policy: pull
|
||||
interruptible: true
|
||||
|
||||
tests:
|
||||
extends: .pip cache template
|
||||
image: python:3.10-alpine
|
||||
stage: test
|
||||
script:
|
||||
- coverage run --source matrix_alertbot -m pytest --junitxml=report.xml
|
||||
- coverage xml -o coverage.xml
|
||||
cache:
|
||||
policy: pull
|
||||
artifacts:
|
||||
reports:
|
||||
coverage_report:
|
||||
coverage_format: cobertura
|
||||
path: coverage.xml
|
||||
junit: report.xml
|
||||
interruptible: true
|
Loading…
Reference in a new issue