Skip to content

Commit

Permalink
JDBC snapshot workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
slvrtrn committed Jan 20, 2025
1 parent ebb1c94 commit 712274f
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 9 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/check-jdbc-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# sed -i -E "s/(com.clickhouse\/clickhouse-jdbc \{:mvn\/version )\".+?\"\}/\1\"\"}/" deps.edn
name: Check with the latest JDBC snapshot

on:
workflow_dispatch:
inputs:
jdbc-version:
description: "JDBC version to use"
required: true

env:
# Temporarily using a fork to disable a few failing tests
METABASE_REPOSITORY: slvrtrn/metabase
METABASE_VERSION: 0.52.x-ch

jobs:
check-local-current-version:
runs-on: ubuntu-latest
steps:
- name: Checkout Metabase Repo
uses: actions/checkout@v4
with:
repository: ${{ env.METABASE_REPOSITORY }}
ref: ${{ env.METABASE_VERSION }}

- name: Checkout Driver Repo
uses: actions/checkout@v4
with:
path: modules/drivers/clickhouse

- name: Prepare JDK 21
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "21"

- name: Add ClickHouse TLS instance to /etc/hosts
run: |
sudo echo "127.0.0.1 server.clickhouseconnect.test" | sudo tee -a /etc/hosts
- name: Start ClickHouse in Docker
uses: hoverkraft-tech/[email protected]
with:
compose-file: "modules/drivers/clickhouse/docker-compose.yml"
down-flags: "--volumes"
services: |
clickhouse
clickhouse_tls
clickhouse_older_version
clickhouse_cluster_node1
clickhouse_cluster_node2
nginx
- name: Install Clojure CLI
run: |
curl -O https://download.clojure.org/install/linux-install-1.11.1.1182.sh &&
sudo bash ./linux-install-1.11.1.1182.sh
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"

- name: Update the JDBC version in deps.edn
working-directory: modules/drivers/clickhouse
run: |
sed -i -E "s/(com.clickhouse\/clickhouse-jdbc \{:mvn\/version )\".+?\"\}/\1\"${{ github.event.inputs.jdbc-version }}\"}/" deps.edn
echo deps.edn
- name: Prepare stuff for pulses
run: yarn build-static-viz

# Use custom deps.edn containing "user/clickhouse" alias to include driver sources
- name: Prepare deps.edn
run: |
mkdir -p /home/runner/.config/clojure
cat modules/drivers/clickhouse/.github/deps.edn | sed -e "s|PWD|$PWD|g" > /home/runner/.config/clojure/deps.edn
- name: Run all tests with the latest ClickHouse version
env:
DRIVERS: clickhouse
run: |
clojure -X:ci:dev:ee:ee-dev:drivers:drivers-dev:test:user/clickhouse
7 changes: 0 additions & 7 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ jobs:
repository: ${{ env.METABASE_REPOSITORY }}
ref: ${{ env.METABASE_VERSION }}

- name: Remove incompatible tests
# metabase.events.view-log-test -> minor precision mismatch, still causes the assertion to fail
# hooks.clojure.test-test -> :clickhouse is not in the set of the bundled drivers
run: |
echo "(ns metabase.events.view-log-test)" > test/metabase/events/view_log_test.clj
echo "(ns hooks.clojure.test-test)" > .clj-kondo/test/hooks/clojure/test_test.clj
- name: Checkout Driver Repo
uses: actions/checkout@v4
with:
Expand Down
3 changes: 1 addition & 2 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{:paths ["src" "resources"]
:deps
{
com.widdindustries/cljc.java-time {:mvn/version "0.1.21"}
{com.widdindustries/cljc.java-time {:mvn/version "0.1.21"}
com.clickhouse/clickhouse-jdbc {:mvn/version "0.7.2"}
org.lz4/lz4-java {:mvn/version "1.8.0"}}}

0 comments on commit 712274f

Please sign in to comment.