Skip to content

Commit b9cadd9

Browse files
committed
Add ClickHouse Workflow
1 parent cffb317 commit b9cadd9

3 files changed

Lines changed: 68 additions & 18 deletions

File tree

.github/ubuntu/clickhouse.sh

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,38 @@
11
#!/bin/bash
22

3+
# This script installs and starts a specific version of ClickHouse server.
4+
# Set CH_RELEASE to the desired release. Examples:
5+
#
6+
# CH_RELEASE=25.9.3.48-stable
7+
# CH_RELEASE=25.8.10.7-lts
8+
39
set -e
410

11+
# Fetch latest version if not specified.
512
# https://clickhouse.com/docs/install
6-
export DEBIAN_FRONTEND=noninteractive
7-
apt-get update -qq
8-
apt-get install -y apt-transport-https ca-certificates curl gnupg
9-
10-
# Download the ClickHouse GPG key and store it in the keyring
11-
curl -fsSL 'https://packages.clickhouse.com/rpm/lts/repodata/repomd.xml.key' \
12-
| gpg --dearmor -o /usr/share/keyrings/clickhouse-keyring.gpg
13+
if [ -z "$CH_RELEASE" ]; then
14+
tsv_url=https://raw.githubusercontent.com/ClickHouse/ClickHouse/master/utils/list-versions/version_date.tsv
15+
CH_RELEASE=$(curl -sL "$tsv_url" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+-(stable|lts)' | sort -V -r | head -n 1)
16+
# List versions: curl -sL "$tsv_url" | grep -E 'stable|lts'
17+
fi
1318

14-
# Get the system architecture
19+
CH_VERSION="${CH_RELEASE%-*}"
1520
ARCH=$(dpkg --print-architecture)
21+
base_url="https://github.com/ClickHouse/ClickHouse/releases/download/v${CH_RELEASE}"
22+
23+
printf "==== ClickHouse %s for %s =====\n\n" "$CH_VERSION" "$ARCH"
24+
cd "${TMPDIR-/tmp}"
25+
26+
# Prevent prompt for password.
27+
export DEBIAN_FRONTEND=noninteractive
1628

17-
# Add the ClickHouse repository to apt sources
18-
echo "deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg arch=${ARCH}] https://packages.clickhouse.com/deb stable main" \
19-
| tee /etc/apt/sources.list.d/clickhouse.list
29+
# Install the packages.
30+
for pkg in clickhouse-common-static clickhouse-server; do
31+
printf "---- Installing %s ----\n\n" "$pkg"
32+
curl -sLo "${pkg}.deb" "${base_url}/${pkg}_${CH_VERSION}_${ARCH}.deb"
33+
dpkg -i "${pkg}.deb"
34+
rm "${pkg}.deb"
35+
done
2036

21-
# Update apt package lists
22-
apt-get update -qq
23-
apt-get install -y clickhouse-server
24-
service clickhouse-server start
37+
printf "---- Starting ClickHouse %s ----\n" "$CH_VERSION"
38+
clickhouse start

.github/workflows/clickhouse.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: 🏠 ClickHouse CI
2+
on:
3+
push:
4+
pull_request:
5+
schedule:
6+
- cron: '0 13 10 * *' # Monthly at 13:00 on the tenth
7+
jobs:
8+
build:
9+
strategy:
10+
matrix:
11+
ch: [25.9.3.48-stable, 25.8.10.7-lts]
12+
os:
13+
- { arch: amd64, on: ubuntu-latest }
14+
- { arch: arm64, on: ubuntu-24.04-arm }
15+
name: 🏠 ClickHouse ${{ matrix.ch }} on ${{ matrix.os.arch }}
16+
runs-on: ${{ matrix.os.on }}
17+
container: pgxn/pgxn-tools
18+
steps:
19+
- name: Start Postgres
20+
run: pg-start 18 libcurl4-openssl-dev uuid-dev
21+
- name: Checkout the Repository
22+
uses: actions/checkout@v4
23+
with: { submodules: true }
24+
- name: Start ClickHouse
25+
env: { CH_RELEASE: "${{ matrix.ch }}" }
26+
run: .github/ubuntu/clickhouse.sh
27+
- name: Test DSO
28+
run: pg-build-test
29+
- name: Clean
30+
run: make clean
31+
- name: Test Static
32+
run: pg-build-test
33+
env: { CH_BUILD: static }
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: 🐘 Postgres CI
22
on:
33
push:
44
pull_request:
@@ -9,8 +9,11 @@ jobs:
99
strategy:
1010
matrix:
1111
pg: [18, 17, 16, 15, 14, 13]
12-
name: 🐘 PostgreSQL ${{ matrix.pg }}
13-
runs-on: ubuntu-latest
12+
os:
13+
- { arch: amd64, on: ubuntu-latest }
14+
- { arch: arm64, on: ubuntu-24.04-arm }
15+
name: 🐘 PostgreSQL ${{ matrix.pg }} on ${{ matrix.os.arch }}
16+
runs-on: ${{ matrix.os.on }}
1417
container: pgxn/pgxn-tools
1518
steps:
1619
- name: Start Postgres ${{ matrix.pg }}

0 commit comments

Comments
 (0)