-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
61 lines (56 loc) · 1.44 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
image: registry.gitlab.com/opium-sh/prl/ci-prl:0.2
variables:
DOCKER_DRIVER: overlay2
stages:
- run_examples
- coverage
- unit_tests
- integration_tests
cache:
key: ${CI_PROJECT_ID}
paths:
- .cache/pip
- venv/
run_examples:
stage: run_examples
variables:
ITERATIONS_NUMBER: 3
script:
- virtualenv venv
- source venv/bin/activate
- pip install -e .
- pip install -r requirements.txt
- ls examples/*.py|xargs -t -n 1 -I '{}' timeout 4m python '{}' --n_iterations $ITERATIONS_NUMBER
coverage:
stage: coverage
when: manual
variables:
ITERATIONS_NUMBER: 3
artifacts:
name: "html_coverage"
paths:
- htmlcov/
- coverage.svg
script:
- virtualenv venv
- source venv/bin/activate
- pip install -e .
- pip install -r requirements.txt
- ls examples/*.py|xargs -t -n 1 -I '{}' timeout 4m sh -c "coverage run --omit \"venv/lib/python3.6/*\" -a '{}' --n_iterations $ITERATIONS_NUMBER"
- coverage report
- coverage html
- CI/generate-bages.sh
unit_tests:
stage: unit_tests
script:
- virtualenv venv
- source venv/bin/activate
- pip install -r requirements.txt
- python -m unittest discover $CI_PROJECT_DIR/tests/unit_tests
.integration_tests:
stage: integration_tests
script:
- virtualenv venv
- source venv/bin/activate
- pip install -r requirements.txt
- python -m unittest discover $CI_PROJECT_DIR/tests/integration_tests