-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
91 lines (83 loc) · 1.9 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
image: python:3.6
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.pip-cache"
stages:
- test
- doc
- deploy
test:2.7:
stage: test
image: python:2.7
allow_failure: false
script:
- python -V
- pip install -r requirements.txt
- git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '`
- flake8
- py.test -vv --cov-config .coveragerc --cov pyconizer tests
#test:3.6:
# stage: test
# image: python:3.6
# cache:
# key: "$CI_PIPELINE_ID"
# paths:
# - "$CI_PROJECT_DIR/.pip-cache"
# allow_failure: false
# script:
# - python -V
# - pip install -r requirements.txt
# - git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '`
# - flake8
# - pip install future
# - py.test -vv --cov-config .coveragerc --cov pyconizer tests
sphinx:
stage: doc
cache:
key: "$CI_PIPELINE_ID"
paths:
- "$CI_PROJECT_DIR/.pip-cache"
script:
- python -V
- pip install -r requirements.txt
- sphinx-versioning build doc/source doc/build/html
artifacts:
paths:
- doc/build/html
expire_in: 1 day
only:
- tags
- master
pages:
stage: deploy
cache:
key: "$CI_PIPELINE_ID"
paths:
- "$CI_PROJECT_DIR/.pip-cache"
dependencies:
- sphinx
script:
- mv doc/build/html/ public/
artifacts:
paths:
- public
expire_in: 1 day
only:
- tags
- master
# Analyze code quality
code_quality:
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [gl-code-quality-report.json]