-
Notifications
You must be signed in to change notification settings - Fork 46
230 lines (222 loc) · 7.04 KB
/
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
name: CI
on: [push, pull_request]
jobs:
macos14:
name: "macOS 14"
runs-on: macos-14
if: "!contains(github.event.head_commit.message, '[skip ci]')"
env:
SKBUILD_CMAKE_ARGS: "-DEXTRA_WARNINGS=ON;-DFETCH_ZLIB_NG=ON"
SKBUILD_CMAKE_TARGETS: "all;check"
steps:
- uses: actions/checkout@v4
- name: Build wheel and install
run: |
python3 -m venv pyenv
source pyenv/bin/activate
python3 -m pip install wheel
python3 -m pip wheel -v .
python3 -m pip install gemmi-*.whl
- name: Python Tests
run: |
source pyenv/bin/activate
python3 -m unittest discover -v -s tests/
python3 -m pip install sphinx
cd docs
sphinx-build -M doctest . _build -n -E
- uses: actions/upload-artifact@v4
with:
name: gemmi-macos14
path: |
./gemmi-*.whl
retention-days: 14
macos11:
name: "macOS 11 (w/o python)"
runs-on: macos-11
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v4
- name: mkdir build
run: cmake -E make_directory ${{runner.workspace}}/build
- name: CMake Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
cmake --version
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SHARED_LIBS=OFF
cmake --build . -j3
cmake --build . --target check -j3
- name: Install
working-directory: ${{runner.workspace}}/build
shell: bash
run: sudo cmake --install .
- name: Test
run: |
ctest --output-on-failure
python3 tests/test_prog.py
- uses: actions/upload-artifact@v4
with:
name: gemmi-macos11
path: |
${{runner.workspace}}/build/gemmi
${{runner.workspace}}/build/libgemmi*
retention-days: 14
windows2022:
name: "Windows 2022"
runs-on: windows-2022
if: "!contains(github.event.head_commit.message, '[skip ci]')"
env:
SKBUILD_CMAKE_ARGS: "-DFETCH_ZLIB_NG=ON"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: build and test
run: |
python -m pip install -v .
python -m pip install numpy
python -m unittest discover -v -s tests/
- name: run doctest
working-directory: ./docs
run: |
python -m pip install sphinx
sphinx-build -M doctest . _build -n -E
ubuntu2204:
name: "Ubuntu 22.04"
runs-on: ubuntu-22.04
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v4
- name: apt-get
run: |
sudo apt-get update
sudo apt-get install libz-dev python3-pip g++ gfortran python3-numpy
- name: install pybind11
run: |
git clone --depth=1 https://github.com/pybind/pybind11.git
#cd pybind11
#cmake . -Wno-dev -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYBIND11_TEST=OFF
#make
#sudo make install
- name: build and test
run: |
g++ --version
cmake --version
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=MinSizeRel -DUSE_FORTRAN=1 -DEXTRA_WARNINGS=1 -DUSE_PYTHON=1 -DPython_EXECUTABLE=/usr/bin/python3 -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_VISIBILITY_PRESET=hidden
make -j2
make -j2 check
sudo make install
python3 -m unittest discover -v -s ../tests/
strip --strip-unneeded ./gemmi ./gemmi.cpython*.so
- name: run doctest
run: |
sudo python3 -m pip install -U sphinx
export PYTHONPATH=$PWD/build
cd docs
sphinx-build -M doctest . _build -n -E
ubuntu2004:
name: "Ubuntu 20.04"
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v4
- name: apt-get
run: |
sudo apt-get update
sudo apt-get install libz-dev python3-pip g++ gfortran python3-numpy valgrind
- name: install pybind11
run: |
python3 -m pip install pybind11
- name: build and test
run: |
g++ --version
cmake --version
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DUSE_PYTHON=1 -DPython_EXECUTABLE=python3 -DBUILD_SHARED_LIBS=OFF
cmake --build . --config Debug -j2
cmake --build . --config Debug --target check -j2
sudo cmake --install . --config Debug
cd ..
python3 -m unittest discover -v -s tests/
- name: run doctest
run: |
sudo pip3 install -U sphinx
cd docs
sphinx-build -M doctest . _build -n -E
- name: run tests under valgrind
run: PYTHONMALLOC=malloc valgrind python3 -m unittest discover -v -s tests/
ubuntu2004_clang6:
name: "Ubuntu 20.04 with Clang 6.0"
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, '[skip ci]')"
env:
CC: clang-6.0
CXX: clang++-6.0
SKBUILD_CMAKE_ARGS: "-DCMAKE_CXX_STANDARD=11;-DEXTRA_WARNINGS=ON;-DSTANDALONE_PYTHON_MODULE=OFF"
SKBUILD_CMAKE_TARGETS: "all;check"
steps:
- uses: actions/checkout@v4
- run: sudo apt-get install clang-6.0 libz-dev python3-pip python3-numpy
- name: install pybind11
run: |
sudo /usr/bin/python3 -m pip install "pybind11[global]" build
- name: build and test
run: |
$CXX --version
python3 -m build --sdist
python3 -m pip install -v dist/gemmi-*.tar.gz
python3 -m unittest discover -v -s tests/
- name: run doctest
run: |
python3 -m pip install -U sphinx
cd docs
sphinx-build -M doctest . _build -n -E
almalinux:
runs-on: ubuntu-latest
name: "AlmaLinux 8"
container: almalinux:8
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v4
- name: yum
run: |
dnf update -y
dnf install -y gcc-c++ cmake make git python38-devel python38-pip
python3.8 -m pip install -U numpy
g++ --version
python3.8 --version
cmake --version
type python3.8
- name: install pybind11
run: |
git clone --branch stable --depth=1 https://github.com/pybind/pybind11.git
cd pybind11
cmake . -Wno-dev -DPYTHON_EXECUTABLE=/usr/bin/python3.8 -DPYBIND11_TEST=OFF
make
make install
- name: build and test
run: |
pwd
cmake . -DUSE_PYTHON=1 -DPython_EXECUTABLE=/usr/bin/python3.8 -DFETCH_ZLIB_NG=ON
make -j2
make -j2 check
make install
python3.8 -m unittest discover -v -s ./tests/
strip --strip-unneeded ./gemmi ./gemmi.cpython*.so
- name: run doctest
run: |
python3.8 -m pip install -U sphinx
cd docs
PYTHONPATH=.. sphinx-build -M doctest . _build -n -E
- uses: actions/upload-artifact@v4
with:
name: gemmi-linux
path: |
./gemmi
./libgemmi_cpp.so
./gemmi.cpython*.so
retention-days: 14