@@ -2,62 +2,79 @@ name: Run Examples
2
2
3
3
on :
4
4
workflow_dispatch :
5
-
5
+ inputs :
6
+ ch_version :
7
+ description : ClickHouse Version
8
+ required : false
9
+ default : 24.8
10
+ client_version :
11
+ description : ClickHouse Java Version
12
+ type : choice
13
+ options :
14
+ - latest
15
+ - pre_release
16
+ pre_release_version :
17
+ description : Client Release Version
18
+ required : false
19
+ default : 0.9.0
20
+
6
21
concurrency :
7
22
group : ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
8
23
cancel-in-progress : true
9
24
25
+
10
26
jobs :
11
- compile :
27
+ run-examples-with-8-jdk-and-latest :
28
+ if : github.event.inputs.client_version == 'latest'
12
29
runs-on : ubuntu-latest
13
30
timeout-minutes : 15
14
- name : Compile (JDK 8)
31
+ name : Run Examples With HEAD on JVM 8
15
32
steps :
16
33
- name : Check out repository
17
34
uses : actions/checkout@v4
18
- - name : Check out PR
35
+ - name : Install JDK 11 and Maven
36
+ uses : actions/setup-java@v4
37
+ with :
38
+ distribution : " temurin"
39
+ java-version : 17
40
+ cache : " maven"
41
+ - name : Install libraries
19
42
run : |
20
- git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 \
21
- origin pull/${{ github.event.inputs.pr }}/merge:merged-pr && git checkout merged-pr
22
- if : github.event.inputs.pr != ''
43
+ java -version
44
+ mvn --batch-mode --no-transfer-progress --show-version --strict-checksums --threads 2 -Dmaven.wagon.rto=30000 -DskipITs install
23
45
- name : Install JDK 8 and Maven
24
46
uses : actions/setup-java@v4
25
47
with :
26
48
distribution : " temurin"
27
- java-version : |
28
- 8
29
- 21
49
+ java-version : 8
30
50
cache : " maven"
31
- - name : Save Repo Artifacts
32
- id : save-repo-artifacts
33
- uses : actions/cache/save@v4
34
- with :
35
- path : ~/.m2/repository/com/clickhouse
36
- key : ${{ github.run_id }}-ch-artifacts
37
- - name : Build and install libraries
38
- run : mvn --batch-mode --no-transfer-progress --show-version --strict-checksums --threads 2 -Dmaven.wagon.rto=30000 -Dj8 -DskipITs install
39
- - name : Compile examples
51
+ - name : Run Examples
40
52
run : |
53
+ java -version
54
+ docker run -d -q --name demo-service-db -e CLICKHOUSE_USER=default -e CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 -e CLICKHOUSE_PASSWORD=secret -p 8123:8123 clickhouse/clickhouse-server:${{ github.event.inputs.ch_version }}
41
55
cd examples/jdbc
42
- mvn clean compile
43
- echo "Run Id ${{ github.run_id }}"
44
- run-examples :
56
+ mvn --batch-mode --no-transfer-progress --show-version clean compile
57
+ mvn --no-transfer-progress exec:java -Dexec.mainClass="com.clickhouse.examples.jdbc.Basic" -DchPassword=secret -DfailOnError=true
58
+ run-examples-with-8-jdk-and-staging-release :
59
+ if : github.event.inputs.client_version == 'pre_release'
45
60
runs-on : ubuntu-latest
46
61
timeout-minutes : 15
47
- name : Run Examples
48
- needs : compile
62
+ name : Run Examples With Pre-Release on JVM 8
49
63
steps :
50
64
- name : Check out repository
51
65
uses : actions/checkout@v4
52
- - name : Restore Repo Artifacts
53
- id : restore-repo-artifacts
54
- uses : actions/cache/restore@v4
66
+ - name : Install JDK 8 and Maven
67
+ uses : actions/setup-java@v4
55
68
with :
56
- path : ~/.m2/repository/com/clickhouse
57
- key : ${{ github.run_id }}-ch-artifacts
69
+ distribution : " temurin"
70
+ java-version : 8
71
+ cache : " maven"
58
72
- name : Run Examples
59
73
run : |
60
- docker run -d --name demo-service-db -e CLICKHOUSE_USER=default -e CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 -e CLICKHOUSE_PASSWORD=secret -p 8123:8123 clickhouse/clickhouse-server:24.8
74
+ java -version
75
+ docker run -d -q --name demo-service-db -e CLICKHOUSE_USER=default -e CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 -e CLICKHOUSE_PASSWORD=secret -p 8123:8123 clickhouse/clickhouse-server:${{ github.event.inputs.ch_version }}
61
76
cd examples/jdbc
77
+ sed -i "s|<clickhouse-java.version>.*<\/clickhouse-java.version>|<clickhouse-java.version>${{ github.event.inputs.pre_release_version }}<\/clickhouse-java.version>|g" pom.xml
78
+ sed -i "s|<url>https:\/\/s01\.oss\.sonatype\.org\/content\/repositories\/snapshots\/<\/url>|<url>https:\/\/s01\.oss\.sonatype\.org\/content\/groups\/staging\/<\/url>|g" pom.xml
62
79
mvn --batch-mode --no-transfer-progress --show-version clean compile
63
- mvn exec:java -Dexec.mainClass="com.clickhouse.examples.jdbc.Basic" -DchPassword=secret -DfailOnError=true
80
+ mvn --no-transfer-progress exec:java -Dexec.mainClass="com.clickhouse.examples.jdbc.Basic" -DchPassword=secret -DfailOnError=true
0 commit comments