-
Notifications
You must be signed in to change notification settings - Fork 92
179 lines (150 loc) · 5.42 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
name: Check
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- "**.md"
pull_request:
env:
METABASE_VERSION: v0.49.12
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
# dataset-definition-test tests test data definition,
# and is currently failing for an unknown reason
run: |
echo "(ns metabase.test.data.dataset-definition-test)" > test/metabase/test/data/dataset_definition_test.clj
- name: Checkout Driver Repo
uses: actions/checkout@v4
with:
path: modules/drivers/clickhouse
- name: Prepare JDK 17
uses: actions/setup-java@v2
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: isbang/[email protected]
with:
compose-file: "modules/drivers/clickhouse/docker-compose.yml"
down-flags: "--volumes"
- 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 ClickHouse driver tests with 23.3
env:
DRIVERS: clickhouse
MB_CLICKHOUSE_TEST_PORT: 8124
run: |
clojure -X:dev:drivers:drivers-dev:test:user/clickhouse :only metabase.driver.clickhouse-test
- name: Run all tests with the latest ClickHouse version
env:
DRIVERS: clickhouse
run: |
clojure -X: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@v2
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: isbang/[email protected]
with:
compose-file: "modules/drivers/clickhouse/docker-compose.yml"
down-flags: "--volumes"
- 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: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