-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
238 lines (220 loc) · 6.19 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
variables:
DEBIAN_FRONTEND: noninteractive
APT_GET_INSTALL: "apt-get install -q -y"
stages:
- pre
- build
- test
- deploy
pre-commit_alpine:
stage: pre
image:
# https://hub.docker.com/_/alpine
name: alpine:latest
script:
- date
- cat /etc/os-release
- apk add --no-cache bash gcc git musl-dev npm py3-pip python3-dev
- pip install pre-commit
# run pre-commit
- pre-commit --version
- pre-commit run --all-files
pycodestyle_alpine:
stage: pre
image:
# https://hub.docker.com/_/alpine
name: alpine:latest
script:
- date
- cat /etc/os-release
- apk add --no-cache py3-pycodestyle
# check PEP 8 code style (pycodestyle was formerly called pep8)
- pycodestyle --version
- pycodestyle --show-source --show-pep8 --statistics $(find -name "*.py")
pylint_alpine:
stage: pre
image:
# https://hub.docker.com/_/alpine
name: alpine:latest
script:
- date
- cat /etc/os-release
- apk add --no-cache py3-pylint py3-setuptools py3-pytest
# run pylint
- pylint --version
- pylint --disable similarities --jobs 0 --persistent n --recursive y .
- echo -e "\nskipped files:"
- echo -e "$(grep -irl skip-file *)"
pylint_debian:
stage: pre
image:
# https://hub.docker.com/_/debian
name: debian:latest
script:
- date
- cat /etc/os-release
- apt-get update
- $APT_GET_INSTALL pylint python3-pytest
# run pylint
- pylint --version
- pylint --disable similarities --jobs 0 --persistent n --recursive y .
- echo -e "\nskipped files:"
- echo -e "$(grep -irl skip-file)"
.debian_based_unittest_template: &debian_based_unittest
stage: test
rules:
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
parallel:
matrix:
- install_method:
- basic
- pip
script:
- date
- cat /etc/os-release
- apt-get update
- test 'basic' = $install_method && $APT_GET_INSTALL python3-setuptools hashdeep
- test 'pip' = $install_method && $APT_GET_INSTALL python3-setuptools python3-pip hashdeep
- env python3 setup.py check_modules
- test 'basic' = $install_method && python3 setup.py install
- test 'pip' = $install_method && (pip3 install . || pip3 install --break-system-packages .)
# run pfu
- which pfu
- pfu -h
- pfu simscrub -h
- pfu create_checksum -h
- pfu check_checksum -h
- pfu replicate -h
- pfu speed_test -h
# unittest
- env python3 setup.py run_unittest
# install dependencies for pytest
- $APT_GET_INSTALL python3-pytest python3-pytest-cov python3-pytest-xdist
# pytest
- env python3 setup.py run_pytest --parallel --coverage
ubuntu:20.04_unittest:
image:
# https://hub.docker.com/_/ubuntu
name: ubuntu:20.04
<<: *debian_based_unittest
ubuntu:22.04_unittest:
image:
# https://hub.docker.com/_/ubuntu
name: ubuntu:22.04
<<: *debian_based_unittest
ubuntu:latest_unittest:
image:
# https://hub.docker.com/_/ubuntu
name: ubuntu:latest
<<: *debian_based_unittest
debian:latest_unittest:
image:
# https://hub.docker.com/_/debian
name: debian:latest
<<: *debian_based_unittest
i386_debian:latest_unittest:
image:
# https://hub.docker.com/_/debian
name: i386/debian:latest
<<: *debian_based_unittest
.suse_based_unittest_template: &suse_based_unittest
stage: test
rules:
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- date
- cat /etc/os-release
- zypper --non-interactive install which python3 python3-pip python3-setuptools python3-pytest python3-pytest-cov python3-pytest-xdist hashdeep
- env python3 -V
- env python3 setup.py check_modules
- env python3 setup.py install --record installed_files.txt
- pfu -h
- xargs rm -rf < installed_files.txt
- pip3 install .
- pfu -h
- pfu simscrub -h
- pfu create_checksum -h
- pfu check_checksum -h
- pfu replicate -h
- pfu speed_test -h
- env python3 setup.py run_unittest
- env python3 setup.py run_pytest --parallel --coverage
opensuse_leap:15.4_unittest:
image:
# https://hub.docker.com/r/opensuse/leap
name: opensuse/leap:15.4
<<: *suse_based_unittest
opensuse_leap:15.5_unittest:
image:
# https://hub.docker.com/r/opensuse/leap
name: opensuse/leap:15.4
<<: *suse_based_unittest
opensuse_leap:latest_unittest:
image:
# https://hub.docker.com/r/opensuse/leap
name: opensuse/leap:latest
<<: *suse_based_unittest
almalinux:latest_unittest:
stage: test
rules:
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
image:
name: almalinux:latest
script:
- date
- cat /etc/os-release
- dnf install -y python3-pip
- env python3 setup.py check_modules
- pip3 install .
# run pfu
- pfu -h
- pfu simscrub -h
- pfu create_checksum -h
- pfu check_checksum -h
- pfu replicate -h
- pfu speed_test -h
# unittest
- env python3 setup.py run_unittest
freebsd:13:
stage: test
rules:
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
tags:
- FreeBSD-13-amd64
script:
- date
- cat /etc/os-release
- freebsd-version
- pkg -v
- pkg install -y devel/py-setuptools devel/py-pytest devel/py-pytest-cov devel/py-pip
- pip install .
- which pfu
- pfu -h
- pfu simscrub -h
- pfu create_checksum -h
- pfu check_checksum -h
- pfu replicate -h
- pfu speed_test -h
- python3.9 setup.py run_unittest
- python3.9 setup.py run_pytest --coverage
deploy_to_github:
stage: deploy
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
image:
# https://hub.docker.com/_/alpine
name: alpine:latest
script:
- date
- cat /etc/os-release
- apk add --no-cache git openssh
- mkdir ~/.ssh && chmod 700 ~/.ssh
- ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- mv $github_deploy_key ~/.ssh/id_ed25519 && chmod 600 ~/.ssh/id_ed25519
- repopath=$(mktemp -d)
- git clone --mirror ${CI_REPOSITORY_URL} $repopath
- (cd $repopath && git push --prune --mirror [email protected]:dlr-pa/pfu.git)