-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
50 lines (46 loc) · 1.48 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
default:
tags:
- docker
image: registry.esss.lu.se/ecdc/ess-dmsc/docker-centos7-build-node:latest
before_script:
- scl enable rh-python38 -- python --version
- scl enable rh-python38 -- pyenv install 3.8 || true
- scl enable rh-python38 -- pyenv install 3.9 || true
- scl enable rh-python38 -- pyenv install 3.10 || true
- scl enable rh-python38 -- pyenv global 3.8 3.9 3.10
- export PATH="/home/jenkins/.pyenv/shims:$PATH"
- scl enable rh-python38 -- pip install --user -r requirements-dev.txt
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
stages:
- "Checks"
- "Tests"
Black:
stage: "Checks"
script:
- scl enable rh-python38 -- python -m black --check .
Tests:
stage: "Tests"
script:
- |
if [ -z "$YUOS_TOKEN" ]; then
echo "Error: YUOS_TOKEN is not set. It is needed for integration testing."
exit 1
fi
- scl enable rh-python38 -- pyenv global 3.8 3.9 3.10
- pyenv versions
- export PATH="/home/jenkins/.pyenv/shims:$PATH"
- python -m tox -- --cov=yuos_query --cov-report=term --cov-report=xml --junitxml=test-output.xml
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
paths:
- test-output.xml
- coverage.xml
reports:
junit: test-output.xml
coverage_report:
coverage_format: cobertura
path: coverage.xml