Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
252 changes: 252 additions & 0 deletions .github/workflows/test_head.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
name: Nightly
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow name 'Nightly' doesn't match the file name 'test_head.yml' or the workflow's purpose (testing against CH HEAD). Consider renaming it to something more descriptive like 'Test Against ClickHouse HEAD' for clarity.


on:
schedule:
- cron: "55 10 * * *"
push:
branches:
- main
paths-ignore:
- "**.md"
- "**/docs/**"
- "**/LICENSE"
- "**/NOTICE"

pull_request:
types:
- opened
- synchronize
- reopened
paths-ignore:
- "**.md"
- "**/docs/**"
- "**/LICENSE"
- "**/NOTICE"
workflow_dispatch:
inputs:
pr:
description: "Pull request#"
required: false

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}
cancel-in-progress: true

env:
CH_VERSION: "HEAD"

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: 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: Copy Artifacts to Build dir
run: |
mkdir clickhouse-jdbc-artifacts
cp -rf $HOME/.m2/repository/com/clickhouse/clickhouse-jdbc/* ./clickhouse-jdbc-artifacts/
- name: Compile examples
run: |
export LIB_VER=$(grep '<revision>' pom.xml | sed -e 's|[[:space:]]*<[/]*revision>[[:space:]]*||g')
find `pwd`/examples -type f -name pom.xml -exec sed -i -e "s|\(<clickhouse-java.version>\).*\(<\)|\1$LIB_VER\2|g" {} \;
for d in $(ls -d `pwd`/examples/*/); do \
if [ -e $d/pom.xml ]; then cd $d && mvn --batch-mode --no-transfer-progress clean compile; fi;
if [ -e $d/gradlew ]; then cd $d && ./gradlew clean build; fi;
done
- name: Save clickhouse-jdbc-all for tests
uses: actions/upload-artifact@v4
with:
name: clickhouse-jdbc-archive
path: clickhouse-jdbc-artifacts/
retention-days: 5

test-java-client:
runs-on: ubuntu-latest
needs: compile
strategy:
matrix:
project: ["clickhouse-http-client", "client-v2"]
fail-fast: false
timeout-minutes: 15
name: Java client ( ${{ matrix.project }} ) + CH ${{ env.CH_VERSION }}
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 17 and Maven
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: |
8
17
cache: "maven"
- name: Setup Toolchain
shell: bash
run: |
mkdir -p $HOME/.m2 \
&& cat << EOF > $HOME/.m2/toolchains.xml
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>17</version>
</provides>
<configuration>
<jdkHome>${{ env.JAVA_HOME }}</jdkHome>
</configuration>
</toolchain>
</toolchains>
EOF
- name: Build and install libraries
run: mvn --batch-mode --no-transfer-progress --show-version --strict-checksums --threads 2 -Dmaven.wagon.rto=30000 -Dj8 -DskipTests=true -Dmaven.javadoc.skip=true install
- name: Test Java client
run: |
mvn --also-make --batch-mode --no-transfer-progress --projects ${{ matrix.project }} -DclickhouseVersion=${{ env.CH_VERSION }} -Dmaven.javadoc.skip=true verify
- name: Upload test results
uses: actions/upload-artifact@v4
if: failure()
with:
name: result ${{ github.job }}_${{ env.CH_VERSION }}
path: |
**/target/failsafe-reports
**/target/surefire-reports
retention-days: 5

test-jdbc-driver:
runs-on: ubuntu-latest
needs: test-java-client
strategy:
matrix:
protocol: ["apache_http_client"]
fail-fast: false
timeout-minutes: 20
name: JDBC driver + CH ${{ env.CH_VERSION }} (${{ matrix.protocol }})
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 17 and Maven
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: |
8
17
cache: "maven"
- name: Setup Toolchain
shell: bash
run: |
mkdir -p $HOME/.m2 \
&& cat << EOF > $HOME/.m2/toolchains.xml
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>17</version>
</provides>
<configuration>
<jdkHome>${{ env.JAVA_HOME }}</jdkHome>
</configuration>
</toolchain>
</toolchains>
EOF
- name: Install Java client
run: mvn --also-make --batch-mode --no-transfer-progress --projects clickhouse-http-client,client-v2 -DskipTests=true -Dmaven.javadoc.skip=true install
- name: Test JDBC driver
run: |
mvn --batch-mode --no-transfer-progress --projects clickhouse-jdbc,jdbc-v2 -DclickhouseVersion=${{ env.CH_VERSION }} -Dprotocol=${{ matrix.protocol }} -Dmaven.javadoc.skip=true verify
- name: Upload test results
uses: actions/upload-artifact@v4
if: failure()
with:
name: result ${{ github.job }}_${{ matrix.project }}_${{ env.CH_VERSION }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The upload-artifact step uses ${{ matrix.project }} in the artifact name, but this job's matrix only defines protocol. This will result in an incorrect artifact name. Consider using ${{ matrix.protocol }} instead or defining a fixed name.

path: |
**/target/failsafe-reports
**/target/surefire-reports

test-r2dbc-driver:
runs-on: ubuntu-latest
needs: test-jdbc-driver
strategy:
matrix:
protocol: ["http"]
r2dbc: ["1.0.0.RELEASE", "0.9.1.RELEASE"]
fail-fast: false
timeout-minutes: 10
name: R2DBC ${{ matrix.r2dbc }} + CH ${{ env.CH_VERSION }} (${{ matrix.protocol }})
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 17 and Maven
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: |
8
17
cache: "maven"
- name: Setup Toolchain
shell: bash
run: |
mkdir -p $HOME/.m2 \
&& cat << EOF > $HOME/.m2/toolchains.xml
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<version>17</version>
</provides>
<configuration>
<jdkHome>${{ env.JAVA_HOME }}</jdkHome>
</configuration>
</toolchain>
</toolchains>
EOF
- name: Install Java client
run: mvn --also-make --no-transfer-progress --batch-mode --projects clickhouse-jdbc -DskipTests=true -Dmaven.javadoc.skip=true install
- name: Test R2DBC ${{ matrix.r2dbc }}
run: |
mvn --batch-mode --no-transfer-progress --projects clickhouse-r2dbc -DclickhouseVersion=${{ env.CH_VERSION}} \
-D'r2dbc-spi.version=${{ matrix.r2dbc }}' -Dprotocol=${{ matrix.protocol }} -Dmaven.javadoc.skip=true verify
- name: Upload test results
uses: actions/upload-artifact@v4
if: failure()
with:
name: result ${{ github.job }}
path: |
**/target/failsafe-reports
**/target/surefire-reports
Loading