Skip to content

Run Examples

Run Examples #6

Workflow file for this run

name: Run Examples
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
cancel-in-progress: true
jobs:
compile:
runs-on: ubuntu-latest
timeout-minutes: 15
name: Compile (JDK 8)
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Check out PR
run: |
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 \
origin pull/${{ github.event.inputs.pr }}/merge:merged-pr && git checkout merged-pr
if: github.event.inputs.pr != ''
- name: Install JDK 8 and Maven
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: |
8
21
cache: "maven"
- name: Save Repo Artifacts
id: save-repo-artifacts
uses: actions/cache/save@v4
with:
path: ~/.m2/repository/com/clickhouse
key: ${{ github.run_id }}-ch-artifacts
- name: Build and install libraries
run: mvn --batch-mode --no-transfer-progress --show-version --strict-checksums --threads 2 -Dmaven.wagon.rto=30000 -Dj8 -DskipITs install
- name: Compile examples
run: |
cd examples/jdbc
mvn clean compile
echo "Run Id ${{ github.run_id }}"
run-examples:
runs-on: ubuntu-latest
timeout-minutes: 15
name: Run Examples
needs: compile
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Restore Repo Artifacts
id: restore-repo-artifacts
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository/com/clickhouse
key: ${{ github.run_id }}-ch-artifacts
- name: Run Examples
run: |
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
cd examples/jdbc
mvn --batch-mode --no-transfer-progress --show-version clean compile
mvn exec:java -Dexec.mainClass="com.clickhouse.examples.jdbc.Basic" -DfailOnError=true