-
Notifications
You must be signed in to change notification settings - Fork 92
189 lines (161 loc) · 5.94 KB
/
check.yml
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
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/compose-action@v2.0.0
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/compose-action@v2.0.0
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