Skip to content

Commit 2de8c5a

Browse files
committed
ci: update github action to use services
1 parent 1503923 commit 2de8c5a

3 files changed

Lines changed: 24 additions & 35 deletions

File tree

.github/workflows/actions.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ on: [push, pull_request]
22
name: build
33
jobs:
44
tests:
5-
runs-on: ubuntu-20.04
5+
runs-on: ubuntu-22.04
66
strategy:
77
matrix:
88
python-version:
@@ -17,6 +17,21 @@ jobs:
1717
- 22.5.1.2079
1818
- 19.3.5
1919
- 18.14.9
20+
include:
21+
- clickhouse-version: 18.14.9
22+
clickhouse-org: yandex
23+
- clickhouse-version: 19.3.5
24+
clickhouse-org: yandex
25+
- clickhouse-version: 22.5.1.2079
26+
clickhouse-org: clickhouse
27+
- clickhouse-version: 23.8.4.69
28+
clickhouse-org: clickhouse
29+
services:
30+
clickhouse-server:
31+
image: ${{ matrix.clickhouse-org }}/clickhouse-server:${{ matrix.clickhouse-version }}
32+
ports:
33+
- 8123:8123
34+
- 9000:9000
2035

2136
name: ${{ matrix.python-version }} CH=${{ matrix.clickhouse-version }}
2237
steps:
@@ -26,11 +41,6 @@ jobs:
2641
with:
2742
python-version: ${{ matrix.python-version }}
2843
architecture: x64
29-
# - name: Login to Docker Hub
30-
# uses: docker/login-action@v1
31-
# with:
32-
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
33-
# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
3444
- name: Install test requirements
3545
run: |
3646
pip install --upgrade pip setuptools wheel
@@ -41,17 +51,6 @@ jobs:
4151
pip install pytest-timeout
4252
- name: Run flake8
4353
run: flake8
44-
- name: Setup /etc/hosts
45-
run: |
46-
# Overriding setup.cfg. Set host=clickhouse-server
47-
sed -i 's/^host=localhost$/host=clickhouse-server/' setup.cfg
48-
# Make host think that clickhouse-server is localhost
49-
echo '127.0.0.1 clickhouse-server' | sudo tee /etc/hosts > /dev/null
50-
- name: Start ClickHouse server container
51-
run: |
52-
echo "VERSION=${{ matrix.clickhouse-version }}" > tests/.env
53-
if [[ "${{ matrix.clickhouse-version }}" > "21.7" ]]; then echo "ORG=clickhouse"; else echo "ORG=yandex" ; fi >> tests/.env
54-
docker-compose -f tests/docker-compose.yml up -d
5554
- name: Run tests
5655
run: coverage run --source=clickhouse_sqlalchemy -m pytest --timeout=10 -v
5756
timeout-minutes: 2

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ on: [push, pull_request]
22
name: build-docs
33
jobs:
44
tests:
5-
runs-on: ubuntu-20.04
5+
runs-on: ubuntu-22.04
66
name: Build docs
77
steps:
88
- uses: actions/checkout@v4
99
- name: Set up Python
1010
uses: actions/setup-python@v5
1111
with:
12-
python-version: 3.11
12+
python-version: 3.12
1313
architecture: x64
1414
- name: Update tools
1515
run: pip install --upgrade pip setuptools wheel

.github/workflows/sa-versions.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ jobs:
1111
clickhouse-version:
1212
- 23.8.4.69
1313
sa-version: [0, 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]
14+
services:
15+
clickhouse-server:
16+
image: clickhouse/clickhouse-server:${{ matrix.clickhouse-version }}
17+
ports:
18+
- 8123:8123
19+
- 9000:9000
1420

1521
name: ${{ matrix.python-version }} SA=2.0.${{ matrix.sa-version }}
1622
steps:
@@ -20,11 +26,6 @@ jobs:
2026
with:
2127
python-version: ${{ matrix.python-version }}
2228
architecture: x64
23-
# - name: Login to Docker Hub
24-
# uses: docker/login-action@v1
25-
# with:
26-
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
27-
# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
2829
- name: Install test requirements
2930
run: |
3031
pip install --upgrade pip setuptools wheel
@@ -34,17 +35,6 @@ jobs:
3435
pip install pytest-timeout
3536
- name: Install SQLAlchemy
3637
run: pip install sqlalchemy==2.0.${{ matrix.sa-version }}
37-
- name: Setup /etc/hosts
38-
run: |
39-
# Overriding setup.cfg. Set host=clickhouse-server
40-
sed -i 's/^host=localhost$/host=clickhouse-server/' setup.cfg
41-
# Make host think that clickhouse-server is localhost
42-
echo '127.0.0.1 clickhouse-server' | sudo tee /etc/hosts > /dev/null
43-
- name: Start ClickHouse server container
44-
run: |
45-
echo "VERSION=${{ matrix.clickhouse-version }}" > tests/.env
46-
if [[ "${{ matrix.clickhouse-version }}" > "21.7" ]]; then echo "ORG=clickhouse"; else echo "ORG=yandex" ; fi >> tests/.env
47-
docker-compose -f tests/docker-compose.yml up -d
4838
- name: Run tests
4939
run: pytest --timeout=10 -v
5040
timeout-minutes: 2

0 commit comments

Comments
 (0)