-
Notifications
You must be signed in to change notification settings - Fork 8
/
.gitlab-ci.yml
72 lines (64 loc) · 1.48 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
stages:
- test
- docker-build
- docker-test
.dind:
image: docker:latest
services:
- docker:dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
tags:
- docker
docker-build:
extends: .dind
stage: docker-build
script:
- docker build -t $CONTAINER_TEST_IMAGE .
- docker push $CONTAINER_TEST_IMAGE
docker-tests:
extends: .dind
stage: docker-test
script:
- docker pull $CONTAINER_TEST_IMAGE
- docker run $CONTAINER_TEST_IMAGE tox run -e pep8,docs
- docker run $CONTAINER_TEST_IMAGE tox run -e py -- tests
- docker run $CONTAINER_TEST_IMAGE tox run -e py -- integration-tests
coverage-test:
image: python:3.8
stage: test
before_script:
- pip install tox
script:
- tox run -e pep8
- tox run -e cov -- tests
tags:
- docker
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
.compatibility-tests:
stage: test
before_script:
- pip install tox
script:
- tox run -e pep8
- tox run -e py -- tests
tags:
- docker
test-py39:
extends: .compatibility-tests
image: python:3.9
test-py310:
extends: .compatibility-tests
image: python:3.10
test-py311:
extends: .compatibility-tests
image: python:3.11