Run Examples #23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Examples | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| ch_version: | |
| description: ClickHouse Version | |
| required: false | |
| default: 24.8 | |
| client_version: | |
| description: ClickHouse Java Version | |
| type: choice | |
| options: | |
| - latest | |
| - pre_release | |
| pre_release_version: | |
| description: Client Release Version | |
| required: false | |
| default: 0.9.0 | |
| 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 == 'latest' | |
| 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 == 'pre_release' | |
| 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 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 | |
| sed -i "s|<clickhouse-java.version>.*<\/clickhouse-java.version>|<clickhouse-java.version>${{ github.event.inputs.pre_release_version }}<\/clickhouse-java.version>|g" pom.xml | |
| 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 | |
| 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 |