[CI] Added tests against CH head #2
Workflow file for this run
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: Test with CH HEAD | |
| 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 HEAD | |
| 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=$CH_VERSION -Dmaven.javadoc.skip=true verify | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: result ${{ github.job }}_HEAD | |
| 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 HEAD (${{ 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=$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 }}_HEAD | |
| 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 HEAD (${{ 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=$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 |