forked from xzkostyan/clickhouse-sqlalchemy
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (79 loc) · 2.75 KB
/
actions.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
on: [push, pull_request]
name: build
jobs:
tests:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
clickhouse-version:
- 22.5.1.2079
- 19.3.5
- 18.14.9
name: ${{ matrix.python-version }} CH=${{ matrix.clickhouse-version }}
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 test requirements
run: |
pip install --upgrade pip setuptools wheel
pip install flake8 flake8-print coverage
python testsrequire.py
python setup.py develop
# Limit each test time execution.
pip install pytest-timeout
- name: Run flake8
run: flake8
- name: Setup /etc/hosts
run: |
# 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: Start ClickHouse server container
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: Run tests
run: coverage run --source=clickhouse_sqlalchemy -m pytest --timeout=10 -v
timeout-minutes: 2
- name: Set up Python for coverage submission
if: ${{ matrix.python-version == '2.7' }}
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: x64
- name: Install coveralls
run: |
# Newer coveralls do not work with github actions.
pip install 'coveralls<3.0.0'
- name: Upload coverage
run: coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: ${{ matrix.python-version }} CH=${{ matrix.clickhouse-version }}
coveralls-finished:
name: Indicate completion to coveralls.io
needs: tests
runs-on: ubuntu-latest
steps:
- name: Finished
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true