|
| 1 | +name: Nightly |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: "55 10 * * *" |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + paths-ignore: |
| 10 | + - "**.md" |
| 11 | + - "**/docs/**" |
| 12 | + - "**/LICENSE" |
| 13 | + - "**/NOTICE" |
| 14 | + |
| 15 | + pull_request: |
| 16 | + types: |
| 17 | + - opened |
| 18 | + - synchronize |
| 19 | + - reopened |
| 20 | + paths-ignore: |
| 21 | + - "**.md" |
| 22 | + - "**/docs/**" |
| 23 | + - "**/LICENSE" |
| 24 | + - "**/NOTICE" |
| 25 | + workflow_dispatch: |
| 26 | + inputs: |
| 27 | + pr: |
| 28 | + description: "Pull request#" |
| 29 | + required: false |
| 30 | + |
| 31 | +concurrency: |
| 32 | + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }} |
| 33 | + cancel-in-progress: true |
| 34 | + |
| 35 | +env: |
| 36 | + CH_VERSION: "HEAD" |
| 37 | + |
| 38 | +jobs: |
| 39 | + compile: |
| 40 | + runs-on: ubuntu-latest |
| 41 | + timeout-minutes: 15 |
| 42 | + name: Compile (JDK 8) |
| 43 | + steps: |
| 44 | + - name: Check out repository |
| 45 | + uses: actions/checkout@v4 |
| 46 | + - name: Check out PR |
| 47 | + run: | |
| 48 | + git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 \ |
| 49 | + origin pull/${{ github.event.inputs.pr }}/merge:merged-pr && git checkout merged-pr |
| 50 | + if: github.event.inputs.pr != '' |
| 51 | + - name: Install JDK 8 and Maven |
| 52 | + uses: actions/setup-java@v4 |
| 53 | + with: |
| 54 | + distribution: "temurin" |
| 55 | + java-version: | |
| 56 | + 8 |
| 57 | + 21 |
| 58 | + cache: "maven" |
| 59 | + - name: Build and install libraries |
| 60 | + run: mvn --batch-mode --no-transfer-progress --show-version --strict-checksums --threads 2 -Dmaven.wagon.rto=30000 -Dj8 -DskipITs install |
| 61 | + - name: Copy Artifacts to Build dir |
| 62 | + run: | |
| 63 | + mkdir clickhouse-jdbc-artifacts |
| 64 | + cp -rf $HOME/.m2/repository/com/clickhouse/clickhouse-jdbc/* ./clickhouse-jdbc-artifacts/ |
| 65 | + - name: Compile examples |
| 66 | + run: | |
| 67 | + export LIB_VER=$(grep '<revision>' pom.xml | sed -e 's|[[:space:]]*<[/]*revision>[[:space:]]*||g') |
| 68 | + find `pwd`/examples -type f -name pom.xml -exec sed -i -e "s|\(<clickhouse-java.version>\).*\(<\)|\1$LIB_VER\2|g" {} \; |
| 69 | + for d in $(ls -d `pwd`/examples/*/); do \ |
| 70 | + if [ -e $d/pom.xml ]; then cd $d && mvn --batch-mode --no-transfer-progress clean compile; fi; |
| 71 | + if [ -e $d/gradlew ]; then cd $d && ./gradlew clean build; fi; |
| 72 | + done |
| 73 | + - name: Save clickhouse-jdbc-all for tests |
| 74 | + uses: actions/upload-artifact@v4 |
| 75 | + with: |
| 76 | + name: clickhouse-jdbc-archive |
| 77 | + path: clickhouse-jdbc-artifacts/ |
| 78 | + retention-days: 5 |
| 79 | + |
| 80 | + test-java-client: |
| 81 | + runs-on: ubuntu-latest |
| 82 | + needs: compile |
| 83 | + strategy: |
| 84 | + matrix: |
| 85 | + project: ["clickhouse-http-client", "client-v2"] |
| 86 | + fail-fast: false |
| 87 | + timeout-minutes: 15 |
| 88 | + name: Java client ( ${{ matrix.project }} ) + CH ${{ env.CH_VERSION }} |
| 89 | + steps: |
| 90 | + - name: Check out repository |
| 91 | + uses: actions/checkout@v4 |
| 92 | + - name: Check out PR |
| 93 | + run: | |
| 94 | + git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 \ |
| 95 | + origin pull/${{ github.event.inputs.pr }}/merge:merged-pr && git checkout merged-pr |
| 96 | + if: github.event.inputs.pr != '' |
| 97 | + - name: Install JDK 17 and Maven |
| 98 | + uses: actions/setup-java@v4 |
| 99 | + with: |
| 100 | + distribution: "temurin" |
| 101 | + java-version: | |
| 102 | + 8 |
| 103 | + 17 |
| 104 | + cache: "maven" |
| 105 | + - name: Setup Toolchain |
| 106 | + shell: bash |
| 107 | + run: | |
| 108 | + mkdir -p $HOME/.m2 \ |
| 109 | + && cat << EOF > $HOME/.m2/toolchains.xml |
| 110 | + <?xml version="1.0" encoding="UTF8"?> |
| 111 | + <toolchains> |
| 112 | + <toolchain> |
| 113 | + <type>jdk</type> |
| 114 | + <provides> |
| 115 | + <version>17</version> |
| 116 | + </provides> |
| 117 | + <configuration> |
| 118 | + <jdkHome>${{ env.JAVA_HOME }}</jdkHome> |
| 119 | + </configuration> |
| 120 | + </toolchain> |
| 121 | + </toolchains> |
| 122 | + EOF |
| 123 | + - name: Build and install libraries |
| 124 | + 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 |
| 125 | + - name: Test Java client |
| 126 | + run: | |
| 127 | + mvn --also-make --batch-mode --no-transfer-progress --projects ${{ matrix.project }} -DclickhouseVersion=${{ env.CH_VERSION }} -Dmaven.javadoc.skip=true verify |
| 128 | + - name: Upload test results |
| 129 | + uses: actions/upload-artifact@v4 |
| 130 | + if: failure() |
| 131 | + with: |
| 132 | + name: result ${{ github.job }}_${{ env.CH_VERSION }} |
| 133 | + path: | |
| 134 | + **/target/failsafe-reports |
| 135 | + **/target/surefire-reports |
| 136 | + retention-days: 5 |
| 137 | + |
| 138 | + test-jdbc-driver: |
| 139 | + runs-on: ubuntu-latest |
| 140 | + needs: test-java-client |
| 141 | + strategy: |
| 142 | + matrix: |
| 143 | + protocol: ["apache_http_client"] |
| 144 | + fail-fast: false |
| 145 | + timeout-minutes: 20 |
| 146 | + name: JDBC driver + CH ${{ env.CH_VERSION }} (${{ matrix.protocol }}) |
| 147 | + steps: |
| 148 | + - name: Check out repository |
| 149 | + uses: actions/checkout@v4 |
| 150 | + - name: Check out PR |
| 151 | + run: | |
| 152 | + git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 \ |
| 153 | + origin pull/${{ github.event.inputs.pr }}/merge:merged-pr && git checkout merged-pr |
| 154 | + if: github.event.inputs.pr != '' |
| 155 | + - name: Install JDK 17 and Maven |
| 156 | + uses: actions/setup-java@v4 |
| 157 | + with: |
| 158 | + distribution: "temurin" |
| 159 | + java-version: | |
| 160 | + 8 |
| 161 | + 17 |
| 162 | + cache: "maven" |
| 163 | + - name: Setup Toolchain |
| 164 | + shell: bash |
| 165 | + run: | |
| 166 | + mkdir -p $HOME/.m2 \ |
| 167 | + && cat << EOF > $HOME/.m2/toolchains.xml |
| 168 | + <?xml version="1.0" encoding="UTF8"?> |
| 169 | + <toolchains> |
| 170 | + <toolchain> |
| 171 | + <type>jdk</type> |
| 172 | + <provides> |
| 173 | + <version>17</version> |
| 174 | + </provides> |
| 175 | + <configuration> |
| 176 | + <jdkHome>${{ env.JAVA_HOME }}</jdkHome> |
| 177 | + </configuration> |
| 178 | + </toolchain> |
| 179 | + </toolchains> |
| 180 | + EOF |
| 181 | + - name: Install Java client |
| 182 | + run: mvn --also-make --batch-mode --no-transfer-progress --projects clickhouse-http-client,client-v2 -DskipTests=true -Dmaven.javadoc.skip=true install |
| 183 | + - name: Test JDBC driver |
| 184 | + run: | |
| 185 | + mvn --batch-mode --no-transfer-progress --projects clickhouse-jdbc,jdbc-v2 -DclickhouseVersion=${{ env.CH_VERSION }} -Dprotocol=${{ matrix.protocol }} -Dmaven.javadoc.skip=true verify |
| 186 | + - name: Upload test results |
| 187 | + uses: actions/upload-artifact@v4 |
| 188 | + if: failure() |
| 189 | + with: |
| 190 | + name: result ${{ github.job }}_${{ matrix.project }}_${{ env.CH_VERSION }} |
| 191 | + path: | |
| 192 | + **/target/failsafe-reports |
| 193 | + **/target/surefire-reports |
| 194 | +
|
| 195 | + test-r2dbc-driver: |
| 196 | + runs-on: ubuntu-latest |
| 197 | + needs: test-jdbc-driver |
| 198 | + strategy: |
| 199 | + matrix: |
| 200 | + protocol: ["http"] |
| 201 | + r2dbc: ["1.0.0.RELEASE", "0.9.1.RELEASE"] |
| 202 | + fail-fast: false |
| 203 | + timeout-minutes: 10 |
| 204 | + name: R2DBC ${{ matrix.r2dbc }} + CH ${{ env.CH_VERSION }} (${{ matrix.protocol }}) |
| 205 | + steps: |
| 206 | + - name: Check out repository |
| 207 | + uses: actions/checkout@v4 |
| 208 | + - name: Check out PR |
| 209 | + run: | |
| 210 | + git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 \ |
| 211 | + origin pull/${{ github.event.inputs.pr }}/merge:merged-pr && git checkout merged-pr |
| 212 | + if: github.event.inputs.pr != '' |
| 213 | + - name: Install JDK 17 and Maven |
| 214 | + uses: actions/setup-java@v4 |
| 215 | + with: |
| 216 | + distribution: "temurin" |
| 217 | + java-version: | |
| 218 | + 8 |
| 219 | + 17 |
| 220 | + cache: "maven" |
| 221 | + - name: Setup Toolchain |
| 222 | + shell: bash |
| 223 | + run: | |
| 224 | + mkdir -p $HOME/.m2 \ |
| 225 | + && cat << EOF > $HOME/.m2/toolchains.xml |
| 226 | + <?xml version="1.0" encoding="UTF8"?> |
| 227 | + <toolchains> |
| 228 | + <toolchain> |
| 229 | + <type>jdk</type> |
| 230 | + <provides> |
| 231 | + <version>17</version> |
| 232 | + </provides> |
| 233 | + <configuration> |
| 234 | + <jdkHome>${{ env.JAVA_HOME }}</jdkHome> |
| 235 | + </configuration> |
| 236 | + </toolchain> |
| 237 | + </toolchains> |
| 238 | + EOF |
| 239 | + - name: Install Java client |
| 240 | + run: mvn --also-make --no-transfer-progress --batch-mode --projects clickhouse-jdbc -DskipTests=true -Dmaven.javadoc.skip=true install |
| 241 | + - name: Test R2DBC ${{ matrix.r2dbc }} |
| 242 | + run: | |
| 243 | + mvn --batch-mode --no-transfer-progress --projects clickhouse-r2dbc -DclickhouseVersion=${{ env.CH_VERSION}} \ |
| 244 | + -D'r2dbc-spi.version=${{ matrix.r2dbc }}' -Dprotocol=${{ matrix.protocol }} -Dmaven.javadoc.skip=true verify |
| 245 | + - name: Upload test results |
| 246 | + uses: actions/upload-artifact@v4 |
| 247 | + if: failure() |
| 248 | + with: |
| 249 | + name: result ${{ github.job }} |
| 250 | + path: | |
| 251 | + **/target/failsafe-reports |
| 252 | + **/target/surefire-reports |
0 commit comments