This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
152 lines (137 loc) · 3.13 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/python/tags/
image: python:3.7
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
LATEX_IMAGE: ghcr.io/xu-cheng/texlive-full:latest
# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache:
paths:
- .cache/pip
- venv/
before_script:
- export https_proxy=http://192.168.4.8:3128/
- export http_proxy=http://192.168.4.8:3128/
- apt update
- apt install libgl-dev -y # Install libgl for imutils python package
- python -V # Print out python version for debugging
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- export CFLAGS=-fcommon # Allow the installation of RPi.GPIO
- pip install -r requirements.txt # Install all needed package
stages:
- test
- execute
- quality
- build
test:
stage: test
script:
- pytest -c setup.cfg
only:
changes:
- clearway/**/*
- tests/**/*
analyse_video_3fps:
stage: execute
script:
- python3 -m clearway -c clearway.toml -i resources/videos/bicycle_3fps.mp4
only:
refs:
- master
- dev
- merge_requests
changes:
- clearway/**/*
- resources/**/*
analyse_video_original:
stage: execute
script:
- python3 -m clearway -c clearway.toml -i resources/videos/bicycle_original.mp4
only:
refs:
- master
- dev
- merge_requests
changes:
- clearway/**/*
- resources/**/*
flake8:
stage: quality
script:
- python -m flake8 --config setup.cfg clearway/
allow_failure: true
only:
changes:
- clearway/**/*
- tests/**/*
black:
stage: quality
script:
- python -m black --check --config pyproject.toml clearway/
allow_failure: true
only:
changes:
- clearway/**/*
- tests/**/*
mypy:
stage: quality
script:
- python -m mypy --install-types --non-interactive --config-file setup.cfg clearway/ # Installs any missing stub packages
allow_failure: true
only:
changes:
- clearway/**/*
- tests/**/*
build_clearway:
stage: build
script:
- python -m build
only:
refs:
- merge_requests
- tags
artifacts:
paths:
- dist/*
latex_research:
stage: build
image: $LATEX_IMAGE
before_script:
- echo Nothing to do
script:
- cd documents/research
- latexmk --verbose
only:
changes:
- documents/research/**/*
refs:
- merge_requests
- tags
artifacts:
paths:
- documents/research/*.pdf
latex_user_guide:
stage: build
image: $LATEX_IMAGE
before_script:
- echo Nothing to do
script:
- cd documents/installationGuide
- latexmk --verbose
only:
changes:
- documents/installationGuide/**/*
refs:
- merge_requests
- tags
artifacts:
paths:
- documents/installationGuide/*.pdf