-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
78 lines (72 loc) · 2.07 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
variables:
PYTHON_ENVIRONMENT_PATH: .venv
PIP_CACHE_DIR: .cache/pip
FF_ENABLE_JOB_CLEANUP: "true"
stages:
- environment
- format
- build-and-test
- cleanup
# Create a python env and cache it
# Note: The cache needs to be removed manually in CI if the python environment
# is changed, by clicking "CI/CD - Pipelines - Clear Runner Caches".
configure_python:
variables:
GIT_STRATEGY: none
tags:
- shell
- catalyst
stage: environment
script:
- /usr/tce/packages/python/python-3.7.2/bin/virtualenv -p /usr/tce/packages/python/python-3.7.2/bin/python3 ${PYTHON_ENVIRONMENT_PATH}
- . ${PYTHON_ENVIRONMENT_PATH}/bin/activate
- PYTHON_EXECUTABLE=$(which python3)
- ${PYTHON_EXECUTABLE} -m pip install matplotlib pandas numpy glob2
- ${PYTHON_EXECUTABLE} -m pip install pytest
- ${PYTHON_EXECUTABLE} -m pip install click==8.0.4
- ${PYTHON_EXECUTABLE} -m pip install black==21.12b0
- ${PYTHON_EXECUTABLE} -m pip install flake8==4.0.1
- ${PYTHON_EXECUTABLE} -m pip install cython multiprocess textX caliper-reader
cache:
paths:
- ${PYTHON_ENVIRONMENT_PATH}
- ${PIP_CACHE_DIR}
.venv:
cache:
paths:
- ${PYTHON_ENVIRONMENT_PATH}
- ${PIP_CACHE_DIR}
policy: pull
lint-format-check:
tags:
- shell
- catalyst
extends: .venv
stage: format
script:
- . ${PYTHON_ENVIRONMENT_PATH}/bin/activate
- $(which python3) --version
- $(which python3) -m flake8 --version
- $(which python3) -m flake8
- $(which python3) -m black --check --diff .
check-license-headers:
tags:
- shell
- catalyst
extends: .venv
stage: format
script:
- . ${PYTHON_ENVIRONMENT_PATH}/bin/activate
- $(which python3) --version
- $(which python3) license.py verify
build-and-test-py37:
tags:
- shell
- catalyst
stage: build-and-test
extends: .venv
script:
- . ${PYTHON_ENVIRONMENT_PATH}/bin/activate
- $(which python3) -m pip install --ignore-installed --no-deps -r requirements.txt
- $(which python3) setup.py install
- PYTHONPATH=. $(which python3) -m pytest