Merge pull request #275 from ClickHouse/0.51.x #392
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
env: | |
METABASE_VERSION: v1.51.1.2 | |
jobs: | |
check-local-current-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Metabase Repo | |
uses: actions/checkout@v4 | |
with: | |
repository: metabase/metabase | |
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: | |
path: modules/drivers/clickhouse | |
- name: Prepare JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- 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: Get M2 cache | |
# uses: actions/cache@v4 | |
# with: | |
# path: | | |
# ~/.m2 | |
# ~/.gitlibs | |
# key: ${{ runner.os }}-clickhouse-${{ hashFiles('**/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 | |
check-local-older-version: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Metabase Repo | |
uses: actions/checkout@v4 | |
with: | |
repository: metabase/metabase | |
ref: ${{ env.METABASE_VERSION }} | |
- name: Checkout Driver Repo | |
uses: actions/checkout@v4 | |
with: | |
path: modules/drivers/clickhouse | |
- name: Prepare JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- 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" | |
# FIXME: We only need to run a few specific tests with `clickhouse_older_version` | |
# Currently, we run all tests with it, which is unnecessary. | |
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: Get M2 cache | |
# uses: actions/cache@v4 | |
# with: | |
# path: | | |
# ~/.m2 | |
# ~/.gitlibs | |
# key: ${{ runner.os }}-clickhouse-${{ hashFiles('**/deps.edn') }} | |
# 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 ClickHouse driver tests with 23.3 | |
env: | |
DRIVERS: clickhouse | |
MB_CLICKHOUSE_TEST_PORT: 8124 | |
run: | | |
clojure -X:ci:dev:ee:ee-dev:drivers:drivers-dev:test:user/clickhouse :only metabase.driver.clickhouse-test | |
build-jar: | |
runs-on: ubuntu-latest | |
needs: [ 'check-local-current-version', 'check-local-older-version' ] | |
steps: | |
- name: Checkout Metabase Repo | |
uses: actions/checkout@v4 | |
with: | |
repository: metabase/metabase | |
ref: ${{ env.METABASE_VERSION }} | |
- name: Checkout Driver Repo | |
uses: actions/checkout@v4 | |
with: | |
path: modules/drivers/clickhouse | |
- 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: Build ClickHouse driver | |
run: | | |
echo "{:deps {metabase/clickhouse {:local/root \"clickhouse\" }}}" > modules/drivers/deps.edn | |
bin/build-driver.sh clickhouse | |
ls -lah resources/modules | |
- name: Archive driver JAR | |
uses: actions/upload-artifact@v4 | |
with: | |
name: clickhouse.metabase-driver.jar | |
path: resources/modules/clickhouse.metabase-driver.jar |