-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
146 lines (128 loc) · 2.97 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
---
stages:
- build
- packages
.build_template: &build_template
stage: build
script:
- pip install -r requirements.txt
- pip install coverage flake8 mock pytest pytest-cov
# - python3 setup.py check -mrs
- flake8 src/pytiger
- pytest --cov pytiger src/pytiger
build-py2.7:
<<: *build_template
image: python:2.7
build-py3.4:
<<: *build_template
image: python:3.4
build-py3.5:
<<: *build_template
image: python:3.5
build-py3.6:
<<: *build_template
image: python:3.6
build-py3.7:
<<: *build_template
image: python:3.7
build-py3.8:
<<: *build_template
image: python:3.8
build-py3.9:
<<: *build_template
image: python:3.9
build-py3.10:
<<: *build_template
image: python:3.10
build-py3.11:
<<: *build_template
image: python:3.11
build-py3.12:
<<: *build_template
image: python:3.12
pages:
stage: build
image: python:3.12
script:
- pip install -r requirements.txt
- pip install sphinx
- sphinx-build docs public
artifacts:
paths:
- public
rpm-source:
stage: build
image: rockylinux:9
before_script:
- yum -y install
git
rpm-build
script:
- if [ -n "$CI_COMMIT_TAG" ]; then
rpm_version="$CI_COMMIT_TAG";
rpm_release="1%{?dist}";
else
rpm_version="$(git describe --always --abbrev=12 | sed s/-/_/g)";
rpm_release="0%{?dist}";
fi
- git archive
--prefix "pytiger-${rpm_version}/"
--output "pytiger-${rpm_version}.tar.gz"
$CI_COMMIT_SHA
- mkdir -p rpmbuild/{SOURCES,SRPMS}
- mv "pytiger-${rpm_version}.tar.gz" rpmbuild/SOURCES
- >-
sed -i
-e "s/^Version: .*\$/Version: ${rpm_version}/"
-e "s/^Release: .*\$/Release: ${rpm_release}/"
pytiger.spec
- rpmbuild -bs
--define="_topdir ${CI_PROJECT_DIR}/rpmbuild"
--define="dist .git"
pytiger.spec
- mv rpmbuild/SRPMS/*.src.rpm .
artifacts:
paths:
- "*.src.rpm"
.rpm-binary-template:
stage: packages
variables:
GIT_STRATEGY: none
before_script:
- yum -y install
epel-release
${rpm_scl:+centos-release-scl}
# https://wiki.rockylinux.org/rocky/repo/#notes-on-crb
- /usr/bin/crb enable || true
- yum -y install
epel-rpm-macros
rpm-build
${rpm_scl:+${rpm_scl}-build}
- |
yum -y install $( \
rpmbuild --rebuild *.src.rpm 2>&1 | \
awk '/is needed by/ { print $1 }')
script:
- mkdir -p rpmbuild/{SOURCES,SRPMS}
- rpmbuild --rebuild
--define="_topdir ${CI_PROJECT_DIR}/rpmbuild"
*.src.rpm
- rm -f *.src.rpm
- mv rpmbuild/RPMS/*/*.rpm .
artifacts:
paths:
- "*.rpm"
epel-7-x86_64:
extends: .rpm-binary-template
image: centos:7
epel-7-sclpy36-x86_64:
extends: .rpm-binary-template
image: centos:7
variables:
rpm_scl: rh-python36
el-8-x86_64:
extends: .rpm-binary-template
image: rockylinux:8
el-9-x86_64:
extends: .rpm-binary-template
image: rockylinux:9