Skip to content

Run Examples

Run Examples #37

Workflow file for this run

name: Run Examples
on:
workflow_dispatch:
inputs:
ch_version:
description: ClickHouse Version
required: false
default: 25.8
client_version:
description: Build Type
type: choice
options:
- head
- nightly
nightly_version:
description: Nightly Version
required: false
default: 0.9.2-SNAPSHOT
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
cancel-in-progress: true
jobs:
run-examples-with-8-jdk-and-latest:
if: github.event.inputs.client_version == 'head'
runs-on: ubuntu-latest
timeout-minutes: 15
name: Run Examples With HEAD on JVM 8
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install JDK 11 and Maven
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 17
cache: "maven"
- name: Install libraries
run: |
java -version
mvn --batch-mode --no-transfer-progress --show-version --strict-checksums --threads 2 -Dmaven.wagon.rto=30000 -DskipITs install
- name: Install JDK 8 and Maven
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 8
cache: "maven"
- name: Run Examples
run: |
java -version
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 }}
cd examples/jdbc
mvn --batch-mode --no-transfer-progress --show-version clean compile
mvn --no-transfer-progress exec:java -Dexec.mainClass="com.clickhouse.examples.jdbc.Basic" -DchPassword=secret -DfailOnError=true
run-examples-with-8-jdk-and-staging-release:
if: github.event.inputs.client_version == 'nightly'
runs-on: ubuntu-latest
timeout-minutes: 15
name: Run Examples With Pre-Release on JVM 8
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install JDK 8 and Maven
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 8
cache: "maven"
- name: Run JDBC Example
run: |
java -version
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 }}
cd examples/jdbc
sed -i "s|<clickhouse-java.version>.*<\/clickhouse-java.version>|<clickhouse-java.version>${{ github.event.inputs.nightly_version }}<\/clickhouse-java.version>|g" pom.xml
mvn --batch-mode --no-transfer-progress --show-version clean compile
mvn --no-transfer-progress exec:java -Dexec.mainClass="com.clickhouse.examples.jdbc.Basic" -DchPassword=secret -DfailOnError=true