-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
45 lines (42 loc) · 993 Bytes
/
.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
workflow:
rules:
- if: "$CI_COMMIT_BRANCH"
stages:
- test
- build
test:
image: $IMAGE
stage: test
retry:
when: script_failure
max: 1
script:
- pip install -r requirements.txt
- pip install -r tests/requirements.txt
- yapf --recursive --diff --parallel .
- pytest --cov=./ --cov-config=.coveragerc --junitxml=$IMAGE-report.xml
artifacts:
when: always
reports:
junit: $IMAGE-report.xml
parallel:
matrix:
- IMAGE:
- "python:3.7-slim"
- "python:3.8-slim"
# Temporarily disable it
# - "python:3.9-slim"
build:
only:
variables:
- $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
image: docker:20.10.12
stage: build
services:
- docker:20.10.12-dind
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:latest
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $IMAGE_TAG -f Dockerfile.prod .
- docker push $IMAGE_TAG