Skip to content

Commit

Permalink
feat: Install clickhouse client in cannon-smoke-test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
samcm committed Aug 9, 2024
1 parent 34fbee8 commit 70f8350
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
7 changes: 6 additions & 1 deletion .github/cannon/assert_clickhouse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ CLICKHOUSE_DB=${CLICKHOUSE_DB:-"default"}

# Function to execute ClickHouse query
execute_query() {
clickhouse client -h "$CLICKHOUSE_HOST" --port "$CLICKHOUSE_PORT" -u "$CLICKHOUSE_USER" --password "$CLICKHOUSE_PASSWORD" -d "$CLICKHOUSE_DB" -q "$1"
# Check if clickhouse-client is available
if command -v clickhouse-client &> /dev/null; then
clickhouse-client -h "$CLICKHOUSE_HOST" --port "$CLICKHOUSE_PORT" -u "$CLICKHOUSE_USER" --password "$CLICKHOUSE_PASSWORD" -d "$CLICKHOUSE_DB" -q "$1"
else
clickhouse client -h "$CLICKHOUSE_HOST" --port "$CLICKHOUSE_PORT" -u "$CLICKHOUSE_USER" --password "$CLICKHOUSE_PASSWORD" -d "$CLICKHOUSE_DB" -q "$1"
fi
}

# Check if the seeding.yaml file exists
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/cannon-smoke-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install clickhouse client
run: |
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg
curl -fsSL 'https://packages.clickhouse.com/rpm/lts/repodata/repomd.xml.key' | sudo gpg --dearmor -o /usr/share/keyrings/clickhouse-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb stable main" | sudo tee \
/etc/apt/sources.list.d/clickhouse.list
sudo apt-get update
sudo apt-get install -y clickhouse-client
clickhouse-client --version
- name: Pull docker compose images in the background
run: |
docker compose pull &
Expand Down Expand Up @@ -92,8 +102,6 @@ jobs:
ethereum:
beaconNodeAddress: "https://bn-holesky-lighthouse-erigon-001.utility.production.platform.ethpandaops.io"
beaconNodeHeaders:
Authorization: "AUTH_HEADER"
coordinator:
address: xatu-server:8080
Expand Down

0 comments on commit 70f8350

Please sign in to comment.