-
Notifications
You must be signed in to change notification settings - Fork 23
/
.gitlab-ci.yml
100 lines (90 loc) · 2.12 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
variables:
DOCKER_BUILDKIT: 1
DOCKER_DRIVER: overlay2
TMPIMG: ci-$CI_JOB_ID
stages:
- Image
- Test
- Publish
- Check
workflow:
rules:
- if: '$CI_SERVER_HOST != "gitlab.com"'
when: never
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
Sign-off check:
stage: Check
image: python:3.7-alpine
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule"'
needs: []
script:
- apk add --no-cache git
- git fetch origin master
- .gitlab-ci/signed-off-by-check > $CI_PROJECT_DIR/sign-off-report.xml
artifacts:
reports:
junit: sign-off-report.xml
# Used by schedule to keep master and latest version tag up-to-date
Image:
stage: Image
image: docker:latest
needs: []
services:
- docker:dind
script:
- apk add --no-cache git curl
- ./.gitlab-ci/build-test-push
- |
if [ "$CI_PIPELINE_SOURCE" = "schedule" ]; then
tag="$(git tag -l 'v*+ce' |tail -1)"
git reset --hard $tag;
export CI_COMMIT_TAG=$tag
export CI_COMMIT_SHA=$(git rev-parse $tag)
./.gitlab-ci/build-test-push
fi
variables:
REPO: $CI_REGISTRY_IMAGE/cache
pytest:
stage: Test
image: $CI_REGISTRY_IMAGE/cache/ci:z-$CI_COMMIT_SHA
needs:
- Image
script:
- . /opt/marv/bin/activate
- python3 -m pip install --no-deps -e code/marv-api
- python3 -m pip install --no-deps -e code/marv-cli
- python3 -m pip install --no-deps -e code/marv
- python3 -m pip install --no-deps -e code/marv-robotics
- ./scripts/build-docs
- ./scripts/download-test-bags
- ./scripts/fetch-deps
- pytest --cache-clear
artifacts:
when: always
paths:
- docs/_build/html
- pytest-report.xml
reports:
junit: pytest-report.xml
variables:
TZ: UTC
pages:
stage: Publish
image: alpine:latest
rules:
- if: '$CI_PIPELINE_SOURCE != "schedule" &&
($CI_COMMIT_BRANCH == "master" || $CI_COMMIT_TAG =~ /^v\d\d\.\d\d\.\d\+ce$/)'
needs:
- Image
- pytest
dependencies:
- pytest
script:
- mv docs/_build/html public
artifacts:
paths:
- public
variables:
GIT_STRATEGY: none