-
Notifications
You must be signed in to change notification settings - Fork 23
/
.gitlab-ci.yml
84 lines (73 loc) · 1.67 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
image: aa1569.lab.hsm:5443/py_tox_tester:latest
# 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"
PYTHON_VERSIONS: "2.7.15 3.6.12 3.7.9 3.8.5 3.9.13 3.10.4"
# 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
stages:
- lint
- test
- build
- deploy
before_script:
- export PATH="$HOME/.pyenv/bin/:$PATH"
- eval "$(pyenv init -)"
- pyenv global ${PYTHON_VERSIONS[@]}
- python -V
- source /.venv/bin/activate
lint:
needs: []
stage: lint
interruptible: true
script:
- pip install black==19.10b0 click==8.0.2
- black --version
- black -l 100 . --check --diff
test:
needs: []
stage: test
script:
- tox -e clean
- tox -p -e py27,py36,py37,py38,py39,py310
- tox -e report
interruptible: true
artifacts:
when: always
paths:
- junit*.xml
reports:
junit: junit*.xml
cobertura: coverage.xml
build:
stage: build
interruptible: true
script:
- |
for py in ${PYTHON_VERSIONS}; do
bin="python$( echo $py | cut -d'.' -f1-2 )"
$bin -m pip install wheel
$bin setup.py bdist_wheel
done
artifacts:
paths:
- dist/*.whl
deploy:
tags:
- hsmtest
stage: deploy
dependencies:
- build
only:
- release
before_script:
- cp $DEPLOYMENT_PRIVKEY ~/.ssh/id_ecdsa
- chmod 600 ~/.ssh/id_ecdsa
script: /root/deploy.sh