-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
144 lines (134 loc) · 3.55 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
image: python:3.7-stretch
variables:
WHEELHOUSE_ALL: ".wheelhouse"
WHEELHOUSE_LINUX: ".wheelhouse-linux"
WHEELHOUSE_MAC: ".wheelhouse-mac"
WHEELHOUSE_WINDOWS: ".wheelhouse-windows"
CENSYN_VERSION: "v0.8.1"
stages:
- build
- test
- release
- package
- package_test
build:
stage: build
script:
- pip wheel -f $WHEELHOUSE_ALL -w $WHEELHOUSE_ALL .
artifacts:
name: "censyn-deps-$CI_JOB_ID"
paths:
- $WHEELHOUSE_ALL
expire_in: 4 h
only: &release_branches # Define the var for branches to include
- develop
- prototype
- /^release\/.*$/
- /^hotfix\/.*$/
- tags
code_quality:
stage: test
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [gl-code-quality-report.json]
expire_in: 2 mo
# Code tests.
test:code:
stage: test
script:
- pip install -r requirements.txt
- python -m unittest
release:
stage: release
dependencies:
- build
script:
- cp $WHEELHOUSE_ALL/censyn* .
- mkdir $WHEELHOUSE_LINUX
- cp $WHEELHOUSE_ALL/*any.whl $WHEELHOUSE_LINUX
- ./download.sh $WHEELHOUSE_LINUX manylinux1_x86_64
- mkdir $WHEELHOUSE_MAC
- cp $WHEELHOUSE_ALL/*any.whl $WHEELHOUSE_MAC
- ./download.sh $WHEELHOUSE_MAC macosx_10_10_x86_64
- mkdir $WHEELHOUSE_WINDOWS
- cp $WHEELHOUSE_ALL/*any.whl $WHEELHOUSE_WINDOWS
- ./download.sh $WHEELHOUSE_WINDOWS win_amd64
artifacts:
name: "censyn-$CI_JOB_ID"
paths:
- censyn*.whl
- $WHEELHOUSE_LINUX
- $WHEELHOUSE_MAC
- $WHEELHOUSE_WINDOWS
- readme.md
- output/
- syn_data/
expire_in: 2 mo
only: *release_branches
# Download all the dependencies for each platform
package:linux:
stage: package
dependencies:
- build
script:
- mkdir $WHEELHOUSE_LINUX
- cp $WHEELHOUSE_ALL/*any.whl $WHEELHOUSE_LINUX
- ./download.sh $WHEELHOUSE_LINUX manylinux1_x86_64
artifacts:
name: "censyn-download-linux-$CENSYN_VERSION-$CI_JOB_ID"
paths:
- $WHEELHOUSE_LINUX
- readme.md
expire_in: 2 mo
only: *release_branches
package:mac:
stage: package
dependencies:
- build
script:
- mkdir $WHEELHOUSE_MAC
- cp $WHEELHOUSE_ALL/*any.whl $WHEELHOUSE_MAC/
- ./download.sh $WHEELHOUSE_MAC macosx_10_10_x86_64
artifacts:
name: "censyn-download-mac-$CENSYN_VERSION-$CI_JOB_ID"
paths:
- $WHEELHOUSE_MAC
- readme.md
expire_in: 2 mo
only: *release_branches
package:windows:
stage: package
dependencies:
- build
script:
- mkdir $WHEELHOUSE_WINDOWS
- cp $WHEELHOUSE_ALL/*any.whl $WHEELHOUSE_WINDOWS/
- ./download.sh $WHEELHOUSE_WINDOWS win_amd64
artifacts:
name: "censyn-download-windows-$CENSYN_VERSION-$CI_JOB_ID"
paths:
- $WHEELHOUSE_WINDOWS
- readme.md
expire_in: 2 mo
only: *release_branches
# Ensure it's offline installable. Use the linux build because the pipeline is linux based.
package_test:offline_build:
stage: package_test
dependencies:
- package:linux
script:
- pip install -I --no-index -f $WHEELHOUSE_LINUX $WHEELHOUSE_LINUX/wheel*
- pip install -I --no-index -f $WHEELHOUSE_LINUX $WHEELHOUSE_LINUX/censyn*
only: *release_branches