File: ci.yml

package info (click to toggle)
gemmi 0.5.7%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 5,344 kB
  • sloc: cpp: 48,972; python: 4,352; ansic: 3,428; sh: 302; makefile: 69; f90: 42; javascript: 12
file content (209 lines) | stat: -rw-r--r-- 6,182 bytes parent folder | download
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
name: CI

on: [push, pull_request]

jobs:
  standard:
    strategy:
      matrix:
        include:
          - os: macos-11
            build: Release
    name: ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    if: "!contains(github.event.head_commit.message, '[skip ci]')"
    steps:
    - uses: actions/checkout@v3

    - name: mkdir build
      run: cmake -E make_directory ${{runner.workspace}}/build

    - name: Configure CMake
      shell: bash
      working-directory: ${{runner.workspace}}/build
      run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build }}

    - name: Build
      working-directory: ${{runner.workspace}}/build
      shell: bash
      run: cmake --build . --config ${{ matrix.build }}

    - name: Test
      working-directory: ${{runner.workspace}}/build
      shell: bash
      run: cmake --build . --config ${{ matrix.build }} --target check

    - name: Python Setup
      run: |
        python3 -m pip wheel -v .
        python3 -m pip install gemmi-*.whl

    - name: Python Tests
      run: python3 -m unittest discover -v -s tests/

    - uses: actions/upload-artifact@v3
      with:
        name: gemmi-macos11
        path: |
          ${{runner.workspace}}/build/gemmi
          ${{runner.workspace}}/gemmi-*.whl
        retention-days: 14


  windows2022:
    name: "Windows 2022"
    runs-on: windows-2022
    if: "!contains(github.event.head_commit.message, '[skip ci]')"
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-python@v4
      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@v3
    - 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
        make -j2
        make -j2 check
        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@v3
    - name: apt-get
      run: |
        sudo apt-get update
        sudo apt-get install libz-dev python3-pip g++ gfortran python3-setuptools python3-numpy valgrind
    - name: build and test
      run: |
        g++ --version
        cmake --version
        mkdir build
        cd build
        cmake .. -DCMAKE_BUILD_TYPE=Debug
        cmake --build . --config Debug
        cmake --build . --config Debug --target check
        cd ..
        python3 setup.py install --user --prefix=
        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/
    - uses: actions/upload-artifact@v3
      with:
        name: gemmi-linux
        path: dist/gemmi*.egg
        retention-days: 14

  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
    steps:
    - uses: actions/checkout@v3
    - run: sudo apt-get install clang-6.0 libz-dev python3-pip python3-setuptools python3-numpy
    - name: install pybind11
      run: |
        sudo /usr/bin/python3 -m pip install "pybind11[global]"
    - name: build and test
      run: |
        $CXX --version
        cmake -DCMAKE_CXX_STANDARD=11 -DEXTRA_WARNINGS=1 .
        make -j2 all
        make -j2 check
        python3 setup.py sdist
        python3 -m pip install -v dist/gemmi-*.tar.gz
        python3 -m unittest discover -v -s tests/

  centos:
    runs-on: ubuntu-latest
    name: "CentOS 7"
    container: centos:7
    if: "!contains(github.event.head_commit.message, '[skip ci]')"
    steps:
    - uses: actions/checkout@v3
    - name: yum
      run: |
        yum update -y && yum install -y epel-release
        yum install -y gcc-c++ cmake3 make git python3-devel
        pip3 install -U numpy
        g++ --version
        python3 --version
        cmake3 --version
        type python3
    - name: install pybind11
      run: |
        git clone --branch stable --depth=1 https://github.com/pybind/pybind11.git
        cd pybind11
        cmake3 . -Wno-dev -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYBIND11_TEST=OFF
        make
        make install
    - name: build and test
      run: |
        pwd
        cmake3 . -DUSE_PYTHON=1 -DPYTHON_EXECUTABLE=/usr/bin/python3
        make -j2
        make -j2 check
        python3 -m unittest discover -v -s ./tests/
        strip --strip-unneeded ./gemmi ./gemmi.cpython*.so
    - name: run doctest
      run: |
        pip3 install -U sphinx
        cd docs
        PYTHONPATH=.. sphinx-build -M doctest . _build -n -E
    - uses: actions/upload-artifact@v3
      with:
        name: gemmi-linux
        path: |
          ./gemmi
          ./gemmi.cpython*.so
        retention-days: 14