forked from ess-dmsc/forwarder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
89 lines (80 loc) · 2.16 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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 -- pip install --user -r requirements-dev.txt
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
stages:
- checks
- test
- integration
black:
stage: checks
script:
- scl enable rh-python38 -- python -m black --check .
flake8:
stage: checks
script:
- scl enable rh-python38 -- python -m flake8
mypy:
stage: checks
script:
- scl enable rh-python38 -- python -m mypy .
test:
stage: test
script:
- 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=forwarder --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
.integration-tests:
stage: integration
image: docker:latest
before_script:
- cd integration_tests
- ./setup.sh
after_script:
- cd integration_tests
- ./teardown.sh
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
variables:
FORWARDER_ZOOKEEPER_CONTAINER_NAME: zookeeper-$CI_JOB_ID
FORWARDER_KAFKA_CONTAINER_NAME: kafka1-$CI_JOB_ID
FORWARDER_SIMPLEIOC_CONTAINER_NAME: simpleioc-$CI_JOB_ID
FORWARDER_FORWARDER_CONTAINER_NAME: forwarder-$CI_JOB_ID
HTTP_PROXY: $ESS_HTTP_PROXY
HTTPS_PROXY: $ESS_HTTP_PROXY
contract-tests:
extends: .integration-tests
script:
- ./run-contract-tests.sh
artifacts:
paths:
- integration_tests/ContractTestsOutput.xml
reports:
junit: integration_tests/ContractTestsOutput.xml
smoke-tests:
extends: .integration-tests
script:
- ./run-smoke-tests.sh
artifacts:
paths:
- integration_tests/SmokeTestsOutput.xml
reports:
junit: integration_tests/SmokeTestsOutput.xml