-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
94 lines (83 loc) · 2.22 KB
/
.gitlab-ci.yml
File metadata and controls
94 lines (83 loc) · 2.22 KB
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
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_REF_NAME == "master"
stages:
- init
- env
- build
- test
- sonarqube
- sync
variables:
# template SonarQube
SONAR_TOKEN: "${CARS_CI_SONARQUBE_TOKEN}"
include:
# Sonarqube job
- component: $CI_SERVER_FQDN/usinelogicielle/public/gitlab-ci-components/sonarqube-component/sonarqube@1.1.0
# Variable defintion
- component: $CI_SERVER_FQDN/dali/cars-park/cars-ci/cars-ci-variables@master
# Jobs for gitlab-github synchronisation
- component: $CI_SERVER_FQDN/dali/cars-park/cars-ci/cars-ci-github@master
# Install shareloc in a virtual-env and export so that following jobs can use it
python-env:
stage: env
image: ${PYTHON_IMAGE}
script:
- pip install virtualenv
- virtualenv python_env
- source python_env/bin/activate
- VENV="python_env" make install
timeout: 15 minutes
artifacts:
untracked: true
expire_in: 1 day
unit-test:
stage: test
image: ${PYTHON_IMAGE}
# Use dedicated runner for end2end tests
tags:
- ${TEST_RUNNER_TAG}
script:
- source python_env/bin/activate
- VENV="python_env" make test
artifacts:
paths:
- ./pytest-report.xml
- ./coverage.xml
expire_in: 1 day
lint:
stage: test
image: ${PYTHON_IMAGE}
needs:
- python-env
allow_failure: true
script:
- VENV="python_env" make lint
artifacts:
paths:
- ./pylint-report.txt
expire_in: 1 day
doc:
stage: test
# The sphinxdoc/docker-ci contains the dependency required to generate the
# Shareloc documentation (latex, dvipng and sphinx)
# https://hub.docker.com/r/sphinxdoc/docker-ci
image: ${UL_ARTIFACTORY_HOST}/publicremotes-docker/sphinxdoc/docker-ci
script:
# Create a venv for documentation generation
- python3 -m venv doc_env
# Call documentation target
- VENV="doc_env" make docs
artifacts:
# Export documentation as artifact, it can be opened directly from gitlab
paths:
- ./docs/build/html/
expire_in: 1 day
# Push git project from gitlab to github
github-sync:
extends:
- .github-sync-base
variables:
BRANCH: "master"
GITHUB_URL: github.com/CNES/shareloc.git