File: actions.yml

package info (click to toggle)
python-clickhouse-driver 0.2.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,516 kB
  • sloc: python: 10,950; pascal: 42; makefile: 29; sh: 3
file content (327 lines) | stat: -rw-r--r-- 10,899 bytes parent folder | download | duplicates (3)
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
on: [push, pull_request]
name: build
jobs:
  tests:
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        use-numpy:
          - 0
        python-version:
          - "3.6"
          - "3.7"
          - "3.8"
          - "3.9"
          - "3.10"
          - "3.11"
          - "pypy-3.6"
          - "pypy-3.7"
        clickhouse-version:
          - 22.2.3.5
          - 21.12.3.32
          - 21.9.3.30
          - 21.9.3.30
          - 21.4.6.55
          - 21.3.10.1
          - 21.2.10.48
          - 21.1.9.41
          - 20.11.2.1
          - 20.10.2.20
          - 20.9.3.45
          - 20.8.4.11
          - 20.7.4.11
          - 20.6.8.5
          - 20.5.5.74
          - 20.4.9.110
          - 20.3.20.6
          - 19.16.17.80
          - 19.15.3.6
          - 19.9.2.4   # allow_suspicious_low_cardinality_types
          - 19.8.3.8   # SimpleAggregateFunction
          - 19.3.3
        include:
          - clickhouse-version: 20.3.20.6
            use-numpy: 1
            python-version: 3.8

    name: ${{ matrix.python-version }} CH=${{ matrix.clickhouse-version }} NUMPY=${{ matrix.use-numpy }}
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
          architecture: x64
#      - name: Login to Docker Hub
#        uses: docker/login-action@v1
#        with:
#          username: ${{ secrets.DOCKER_HUB_USERNAME }}
#          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
      - name: Install flake8
        run: |
          pip install --upgrade pip setuptools wheel
          pip install flake8 flake8-print
      - name: Run flake8
        run: flake8
      - name: Start ClickHouse server and client containers
        run: |
          echo "VERSION=${{ matrix.clickhouse-version }}" > tests/.env
          if [[ "${{ matrix.clickhouse-version }}" > "21.7" ]]; then echo "ORG=clickhouse"; else echo "ORG=yandex" ; fi  >> tests/.env
          docker-compose -f tests/docker-compose.yml up -d
      - name: Setup clickhouse-client proxy for docker
        run: |
          # Faking clickhouse-client real communication with container via docker exec.
          echo -e '#!/bin/bash\n\ndocker exec -e "`env | grep ^TZ=`" test-clickhouse-client clickhouse client "$@"' | sudo tee /usr/local/bin/clickhouse-client > /dev/null
          sudo chmod +x /usr/local/bin/clickhouse-client
          # Overriding setup.cfg. Set host=clickhouse-server
          sed -i 's/^host=localhost$/host=clickhouse-server/' setup.cfg
          # Make host think that clickhouse-server is localhost
          echo '127.0.0.1 clickhouse-server' | sudo tee /etc/hosts > /dev/null
      - name: Build cython extensions with tracing
        run: CYTHON_TRACE=1 python setup.py build_ext --define CYTHON_TRACE
        if: ${{ !contains(matrix.python-version, 'pypy') }}
      - name: Install requirements
        run: |
          # Newer coveralls do not work with github actions.
          pip install 'coveralls<3.0.0'
          pip install cython
          python testsrequire.py
          python setup.py develop
          # Limit each test time execution.
          pip install pytest-timeout
        env:
          USE_NUMPY: ${{ matrix.use-numpy }}
      - name: Run tests
        run: coverage run -m pytest --timeout=10 -v
        timeout-minutes: 5
        env:
          # Set initial TZ for docker exec -e "`env | grep ^TZ`"
          TZ: UTC
      - name: Upload coverage
        run: coveralls
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          COVERALLS_PARALLEL: true
          COVERALLS_FLAG_NAME: ${{ matrix.python-version }} CH=${{ matrix.clickhouse-version }} NUMPY=${{ matrix.use-numpy }}

  coveralls-finished:
    name: Indicate completion to coveralls.io
    needs: tests
    runs-on: ubuntu-latest
    steps:
      - name: Finished
        uses: coverallsapp/github-action@1.1.3
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          parallel-finished: true

  valgrind:
    name: Valgrind check
    needs: tests
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.8
          architecture: x64
      - name: Install valgrind
        run: sudo apt-get update && sudo apt-get install -y valgrind
#      - name: Login to Docker Hub
#        uses: docker/login-action@v1
#        with:
#          username: ${{ secrets.DOCKER_HUB_USERNAME }}
#          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
      - name: Start ClickHouse server and client containers
        run: |
          echo "VERSION=$VERSION" > tests/.env
          if [[ "$VERSION" > "21.7" ]]; then echo "ORG=clickhouse"; else echo "ORG=yandex" ; fi  >> tests/.env
          docker-compose -f tests/docker-compose.yml up -d
        env:
          VERSION: 20.3.7.46
      - name: Setup clickhouse-client proxy for docker
        run: |
          # Faking clickhouse-client real communication with container via docker exec.
          echo -e '#!/bin/bash\n\ndocker exec -e "`env | grep ^TZ=`" test-clickhouse-client clickhouse-client "$@"' | sudo tee /usr/local/bin/clickhouse-client > /dev/null
          sudo chmod +x /usr/local/bin/clickhouse-client
          # Overriding setup.cfg. Set host=clickhouse-server
          sed -i 's/^host=localhost$/host=clickhouse-server/' setup.cfg
          # Make host think that clickhouse-server is localhost
          echo '127.0.0.1 clickhouse-server' | sudo tee /etc/hosts > /dev/null
      - name: Install requirements
        run: |
          python testsrequire.py
          python setup.py develop
        env:
          USE_NUMPY: 1
      - name: Run tests under valgrind
        run: valgrind --error-exitcode=1 --suppressions=valgrind.supp py.test -v
        env:
          # Set initial TZ for docker exec -e "`env | grep ^TZ`"
          TZ: UTC
          USE_NUMPY: 1
          PYTHONMALLOC: malloc

  wheels-linux:
    name: Wheels for Linux
    needs: valgrind
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.8
          architecture: x64
#      - name: Login to Docker Hub
#        uses: docker/login-action@v1
#        with:
#          username: ${{ secrets.DOCKER_HUB_USERNAME }}
#          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
      - name: Install cibuildwheel
        run: |
          pip install --upgrade pip setuptools
          pip install cython cibuildwheel==$VERSION
        env:
          VERSION: 2.11.2
      - name: Build wheels
        run: cibuildwheel --output-dir wheelhouse
        env:
          CIBW_BUILD: '*p3*'
          CIBW_BEFORE_BUILD: pip install cython
      - uses: ncipollo/release-action@v1
        name: Upload wheels
        if: ${{ github.ref_type == 'tag' }}
        with:
          artifacts: "wheelhouse/*"
          allowUpdates: true
          draft: true
          tag: Linux
          token: ${{ secrets.GITHUB_TOKEN }}

  wheels-macos:
    name: Wheels for OS X
    needs: valgrind
    runs-on: macos-10.15
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.8
          architecture: x64
#      - name: Login to Docker Hub
#        uses: docker/login-action@v1
#        with:
#          username: ${{ secrets.DOCKER_HUB_USERNAME }}
#          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
      - name: Install cibuildwheel
        run: |
          pip install --upgrade pip setuptools
          pip install cython cibuildwheel==$VERSION
        env:
          VERSION: 2.11.2
      - name: Build wheels
        run: cibuildwheel --output-dir wheelhouse
        env:
          CIBW_BUILD: '*p3*'
          CIBW_BEFORE_BUILD: pip install cython
      - uses: ncipollo/release-action@v1
        name: Upload wheels
        if: ${{ github.ref_type == 'tag' }}
        with:
          artifacts: "wheelhouse/*"
          allowUpdates: true
          draft: true
          tag: OS X
          token: ${{ secrets.GITHUB_TOKEN }}

  wheels-windows:
    name: Wheels for Windows
    needs: valgrind
    runs-on: windows-2019
    steps:
      - name: Set git to use repo line breaks
        run: |
          git config --global core.autocrlf false
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.8
          architecture: x64
#      - name: Login to Docker Hub
#        uses: docker/login-action@v1
#        with:
#          username: ${{ secrets.DOCKER_HUB_USERNAME }}
#          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
      - name: Install cibuildwheel
        run: |
          pip install cibuildwheel==$env:VERSION
        env:
          VERSION: 2.11.2
      - name: Build wheels
        run: cibuildwheel --output-dir wheelhouse
        env:
          CIBW_BUILD: '*p3*'
          CIBW_BEFORE_BUILD: pip install cython
      - uses: ncipollo/release-action@v1
        name: Upload wheels
        if: ${{ github.ref_type == 'tag' }}
        with:
          artifacts: "wheelhouse/*"
          allowUpdates: true
          draft: true
          tag: Windows
          token: ${{ secrets.GITHUB_TOKEN }}

  wheels-linux-non-x86:
    name: Wheels for Linux non-x86
    needs: valgrind
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        arch:
          - aarch64
          - ppc64le
          - s390x
    steps:
      - uses: actions/checkout@v2.1.0
#      - name: Login to Docker Hub
#        uses: docker/login-action@v1
#        with:
#          username: ${{ secrets.DOCKER_HUB_USERNAME }}
#          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.8
          architecture: x64
      - name: Set up QEMU
        id: qemu
        uses: docker/setup-qemu-action@v1.2.0
        with:
          image: tonistiigi/binfmt:latest
          platforms: all
      - name: Install cibuildwheel
        run: |
          pip install --upgrade pip setuptools
          pip install cibuildwheel==$VERSION
        env:
          VERSION: 2.11.2
      - name: Build wheels
        run: cibuildwheel --output-dir wheelhouse
        env:
          CIBW_BUILD: '*p3*'
          CIBW_BEFORE_BUILD: pip install cython
          CIBW_ARCHS: ${{ matrix.arch }}
      - uses: ncipollo/release-action@v1
        name: Upload wheels
        if: ${{ github.ref_type == 'tag' }}
        with:
          artifacts: "wheelhouse/*"
          allowUpdates: true
          draft: true
          tag: Linux non-x86
          token: ${{ secrets.GITHUB_TOKEN }}