-
Notifications
You must be signed in to change notification settings - Fork 52
/
.gitlab-ci.yml
34 lines (29 loc) · 1.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
stages:
- stylecheck
.conda_env: &conda_env
before_script:
# update conda
- conda config --set always_yes yes
- conda update -q conda
# create and activate environment
- conda create -q -n testenv_${CI_PIPELINE_ID}_${CI_JOB_NAME}_py${PYTHON_VERSION_TO_USE//./} python=${PYTHON_VERSION_TO_USE}
- source activate testenv_${CI_PIPELINE_ID}_${CI_JOB_NAME}_py${PYTHON_VERSION_TO_USE//./}
after_script:
# remove environment
- conda env remove --name testenv_${CI_PIPELINE_ID}_${CI_JOB_NAME}_py${PYTHON_VERSION_TO_USE//./}
style_check:
<<: *conda_env
stage: stylecheck
only:
- triggers
- master
- schedules
variables:
PYTHON_VERSION_TO_USE: "3.7"
script:
# install packages
- conda install -q pycodestyle pylint
# check style using pep8
- pycodestyle --show-source --show-pep8 .
# check style using pylint (without taking into account)
- find . -name "*.py" | xargs pylint --rcfile=$CI_PROJECT_DIR/.pylintrc || true