-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
128 lines (115 loc) · 2.93 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
variables:
# The mocasin branch to clone. We set the default to the current ref of this
# repository, but this variable can be overwritten by an upstream pipeline.
MOCASIN_BRANCH: $CI_COMMIT_REF_NAME
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
stages:
- maintenance
- build
- test
# keep a separate master-ci branch that mirrors the master branch. This helps
# with multi-project pipelines. So the upstream pipeline in mocasin can trigger
# the local pipeline on the master-ci branch with interfering with other local
# pipelines run on master.
mirror-ci-branch:
stage: maintenance
script:
- git push -o ci.skip https://project_206_bot1:${CI_ACCESS_TOKEN}@cc.inf.tu-dresden.de/gitlab/mocasin/fivegsim HEAD:master-ci
only:
- master
tags:
- python3.9
.build:
script:
# install dependencies for builing mpsym and qdldl from source
- apt-get update
- apt-get install -y build-essential cmake libboost-dev libboost-graph-dev lua5.3 liblua5.3-dev luarocks
# Clone mocasin from branch $MOCASIN_BRANCH or master if the branch does not exist
- git clone -b $MOCASIN_BRANCH https://gitlab-ci-token:${CI_JOB_TOKEN}@cc.inf.tu-dresden.de/gitlab/mocasin/mocasin /tmp/mocasin || git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@cc.inf.tu-dresden.de/gitlab/mocasin/mocasin /tmp/mocasin
# build the wheels
- pip wheel -w wheels /tmp/mocasin ."[dev]"
artifacts:
paths:
- wheels
# make pip's cache persistent across pipelines
cache:
key: "$CI_JOB_NAME"
paths:
- .cache/pip
build-python3.10:
extends: .build
stage: build
image: python:3.10
tags:
- python3.10
build-python3.9:
extends: .build
stage: build
image: python:3.9
tags:
- python3.9
build-python3.8:
extends: .build
stage: build
image: python:3.8
tags:
- python3.8
build-python3.7:
extends: .build
stage: build
image: python:3.7
tags:
- python3.7
.test:
script:
# install runtime dependencies for mpsym
- apt-get update
- apt-get install -y lua5.3 liblua5.3 luarocks
# install fivegsim and dependencies
- pip install "fivegsim[dev]" --no-index --find-links=./wheels
# run tests
- export HYDRA_FULL_ERROR=1
- python -m pytest
test-python3.10:
extends: .test
stage: test
image: python:3.10
tags:
- python3.10
needs:
- build-python3.10
test-python3.9:
extends: .test
stage: test
image: python:3.9
tags:
- python3.9
needs:
- build-python3.9
test-python3.8:
extends: .test
stage: test
image: python:3.8
tags:
- python3.8
needs:
- build-python3.8
test-python3.7:
extends: .test
stage: test
image: python:3.7
tags:
- python3.7
needs:
- build-python3.7
check-formatting:
stage: test
image: python:3.9
tags:
- python3.9
needs: []
script:
- pip install black
- black --check .