-
Notifications
You must be signed in to change notification settings - Fork 16
/
.gitlab-ci.yml
93 lines (83 loc) · 1.81 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
90
91
92
93
image: python:3.8.11-slim
stages:
- unit_test_non_slow
- unit_test_slow
- pre
- build
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
cache:
paths:
- .cache/pip
- .venv
run_non_slow_unit_tests:
stage: unit_test_non_slow
tags:
- dind
before_script:
- python -m venv .venv
- source .venv/bin/activate
script:
- apt-get update
- apt-get -y install build-essential
- apt-get update
- pip install -e . -r tests/requirements_test.txt
- echo 'Execute not slow unit tests'
- pytest -m 'not slow' tests/
run_slow_unit_tests:
stage: unit_test_slow
tags:
- dind
when: manual
before_script:
- python -m venv .venv
- source .venv/bin/activate
needs:
- run_non_slow_unit_tests
script:
- apt-get update
- apt-get -y install build-essential
- apt-get update
- pip install -e . -r tests/requirements_test.txt
- echo 'Execute not slow unit tests'
- pytest -m slow tests/
generate_demo_api_yaml:
stage: pre
tags:
- dind
image: alpine:latest
script:
- apk add -U jsonnet
- jsonnet jsonnet/demo-api.jsonnet > generated-config.yml
artifacts:
paths:
- generated-config.yml
generate_dev_demo_api_yaml:
stage: pre
tags:
- dind
image: alpine:latest
script:
- apk add -U jsonnet
- jsonnet jsonnet/dev-demo-api.jsonnet > generated-config.yml
artifacts:
paths:
- generated-config.yml
build_and_push_demo_api:
stage: build
allow_failure: true
needs:
- generate_demo_api_yaml
trigger:
include:
- artifact: generated-config.yml
job: generate_demo_api_yaml
build_and_push_dev_demo_api:
stage: build
allow_failure: true
needs:
- generate_dev_demo_api_yaml
trigger:
include:
- artifact: generated-config.yml
job: generate_dev_demo_api_yaml