forked from hltcoe/concrete-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
98 lines (86 loc) · 2.06 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
stages:
- build
- stylecheck
- 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
build-accelerated:
extends: .dind
stage: build
script:
- docker build -t $CONTAINER_TEST_IMAGE --file Dockerfile .
- docker push $CONTAINER_TEST_IMAGE
only:
- master
- tags
build-py35:
extends: .dind
stage: build
script:
- docker build -t $CONTAINER_TEST_IMAGE-py35 --file Dockerfile.py35 .
- docker push $CONTAINER_TEST_IMAGE-py35
# pep8 runs different tests for different Python versions
test-py35-pep8:
extends: .dind
stage: stylecheck
script:
- docker pull $CONTAINER_TEST_IMAGE-py35
- docker run $CONTAINER_TEST_IMAGE-py35 tox -e pep8
test-py35-docs:
extends: .dind
stage: test
script:
- docker pull $CONTAINER_TEST_IMAGE-py35
- docker run $CONTAINER_TEST_IMAGE-py35 tox -e docs
test-py35-tests:
extends: .dind
stage: test
script:
- docker pull $CONTAINER_TEST_IMAGE-py35
- touch coverage.xml
- docker run --mount type=bind,source=$PWD/coverage.xml,target=/tmp/concrete-python/coverage.xml $CONTAINER_TEST_IMAGE-py35 tox -e cov tests
artifacts:
reports:
cobertura: coverage.xml
test-py35-integration-tests:
extends: .dind
stage: test
script:
- docker pull $CONTAINER_TEST_IMAGE-py35
- docker run $CONTAINER_TEST_IMAGE-py35 tox -e py35 integration-tests
.test-compat:
stage: test
before_script:
- python setup.py install
- pip install flake8
- pip install -r test-requirements.txt
script:
- flake8
- pytest tests integration-tests
only:
- master
- tags
tags:
- docker
test-py36:
extends: .test-compat
image: python:3.6
test-py37:
extends: .test-compat
image: python:3.7
test-py38:
extends: .test-compat
image: python:3.8
test-py39:
extends: .test-compat
image: python:3.9