forked from os2datascanner/os2datascanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
112 lines (94 loc) · 2.43 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
stages:
- notices
- test
- check
- build
variables:
XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- .cache/
notice:
stage: notices
image: python:3.6
services:
- postgres:alpine
- rabbitmq:alpine
variables:
POSTGRES_DB: os2datascanner
POSTGRES_USER: os2datascanner
POSTGRES_PASSWORD: os2datascanner
POSTGRES_HOST: postgres
AMQP_HOST: rabbitmq
DJANGO_SETTINGS_MODULE: os2datascanner.projects.admin.settings
script:
- apt-get update -qq
- apt-get install -qq $(cat requirements/test_dependencies.txt)
- pip install -e . -r requirements/requirements-dev.txt
- django-admin makemigrations --check --dry-run
- python -m unittest discover -s src/ -p notice*.py
allow_failure: true
tests:
stage: test
services:
- postgres:alpine
- rabbitmq:alpine
image: python:3.6
variables:
POSTGRES_DB: os2datascanner
POSTGRES_USER: os2datascanner
POSTGRES_PASSWORD: os2datascanner
POSTGRES_HOST: postgres
AMQP_HOST: rabbitmq
DJANGO_SETTINGS_MODULE: os2datascanner.projects.admin.settings
coverage: '/^TOTAL\s+\d+\s+\d+\s+\d+\s+\d+\s+(\d+(?:\.\d+)?\%)$/'
script:
- apt-get update -qq
- apt-get install -qq $(cat requirements/test_dependencies.txt)
- pip install -e . -r requirements/requirements-dev.txt
- django-admin makemigrations --check --dry-run
- coverage erase
- coverage run -m django test os2datascanner.tests
after_script:
- coverage html
- coverage xml
- coverage report
artifacts:
name: "$CI_JOB_STAGE-$CI_COMMIT_REF_NAME"
paths:
- htmlcov
- build/test-results.xml
- build/coverage.xml
reports:
junit: build/test-results.xml
flake8:
stage: check
image: python:latest
allow_failure: true
script:
- pip install flake8 flake8-gl-codeclimate
- flake8 --exit-zero --format gl-codeclimate --tee --output-file build/code-quality.json src/
artifacts:
name: "$CI_JOB_STAGE-$CI_COMMIT_REF_NAME"
paths:
- build/code-quality.json
reports:
codequality: build/code-quality.json
black:
stage: check
image: python:latest
allow_failure: true
script:
- pip install black
- black --check src
docs:
stage: build
image: keimlink/sphinx-doc:latex
script:
- make -C doc PAPER=a4 html latexpdf
- mv doc/_build .
artifacts:
name: "$CI_JOB_STAGE-$CI_COMMIT_REF_NAME"
paths:
- _build