Skip to content

Commit 051e7e8

Browse files
authored
Merge pull request #2402 from ClickHouse/ci_run_examples
added new workflow to run examples in ci
2 parents 77b5b2e + dc34860 commit 051e7e8

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/run_examples.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Examples
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: "Release version"
8+
required: true
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
compile:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 15
18+
name: Compile (JDK 8)
19+
steps:
20+
- name: Check out repository
21+
uses: actions/checkout@v4
22+
- name: Check out PR
23+
run: |
24+
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 \
25+
origin pull/${{ github.event.inputs.pr }}/merge:merged-pr && git checkout merged-pr
26+
if: github.event.inputs.pr != ''
27+
- name: Install JDK 8 and Maven
28+
uses: actions/setup-java@v4
29+
with:
30+
distribution: "temurin"
31+
java-version: |
32+
8
33+
21
34+
cache: "maven"
35+
- name: Build and install libraries
36+
run: mvn --batch-mode --no-transfer-progress --show-version --strict-checksums --threads 2 -Dmaven.wagon.rto=30000 -Dj8 -DskipITs install
37+
- name: Compile examples
38+
run: |
39+
cd examples/jdbc
40+
mvn clean compile
41+
run-examples:
42+
runs-on: ubuntu-latest
43+
timeout-minutes: 15
44+
name: Run Examples
45+
steps:
46+
- name: Run Docker
47+
run: |
48+
docker run -d --name demo-service-db -e CLICKHOUSE_USER=default -e CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 -e CLICKHOUSE_PASSWORD=secret\
49+
-p 8123:8123 clickhouse/clickhouse-server
50+
cd examples/jdbc
51+
mvn
52+
mvn exec:java -Dexec.mainClass="com.clickhouse.examples.jdbc.Basic"

0 commit comments

Comments
 (0)