-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
62 lines (59 loc) · 1.74 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
before_script:
# setup ssh access to clone python-linstor dep
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan $GIT_HOST >> ~/.ssh/known_hosts
# now install python-linstor into venv
- pushd /tmp
- python -m venv venv
- git clone --recursive git@$GIT_HOST:$PYTHON_LINSTOR_PATH
- cd linstor-api-py
- ../venv/bin/python setup.py install
- ../venv/bin/pip install --trusted-host pypi.python.org xmlrunner
- popd
test:2.7:
stage: test
image: python:2.7
before_script:
# setup ssh access to clone python-linstor dep
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan $GIT_HOST >> ~/.ssh/known_hosts
- pip install virtualenv
# now install python-linstor into venv
- pushd /tmp
- python -m virtualenv venv
- git clone --recursive git@$GIT_HOST:$PYTHON_LINSTOR_PATH
- cd linstor-api-py
- make gensrc
- ../venv/bin/python setup.py install
# and also install xmlrunner package
- ../venv/bin/pip install --trusted-host pypi.python.org xmlrunner
- popd
script:
- /tmp/venv/bin/python tests.py
artifacts:
reports:
junit: test-reports/TEST-*.xml
test:3.5:
stage: test
image: python:3.5
script:
- /tmp/venv/bin/python tests.py
artifacts:
reports:
junit: test-reports/TEST-*.xml
test:3.8:
stage: test
image: python:3.8
script:
- /tmp/venv/bin/python tests.py
artifacts:
reports:
junit: test-reports/TEST-*.xml