forked from ClickHouse/clickhouse-java
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (95 loc) · 2.99 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Build
on:
push:
branches:
- master
- develop
- 0.2.x
paths-ignore:
- "**.md"
- "docs/**"
- "**/CHANGELOG"
pull_request:
types:
- opened
- synchronize
- reopened
paths-ignore:
- "**.md"
- "docs/**"
- "**/CHANGELOG"
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
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# most recent LTS releases as well as latest stable builds
clickhouse: ["21.8", "22.3", "latest"]
# http2 here represents http protocol + JDK HttpClient(http_connection_provider=HTTP_CLIENT)
protocol: ["http", "http2", "grpc"]
exclude:
- clickhouse: "21.8"
protocol: grpc
fail-fast: false
timeout-minutes: 30
name: Build against ClickHouse ${{ matrix.clickhouse }} (${{ matrix.protocol }})
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- 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 11
uses: AdoptOpenJDK/install-jdk@v1
with:
version: '11'
targets: 'JDK11_HOME'
- 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>11</version>
</provides>
<configuration>
<jdkHome>${{ env.JDK11_HOME }}</jdkHome>
</configuration>
</toolchain>
</toolchains>
EOF
- name: Install JDK 8 and Maven
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
cache: 'maven'
# or take below workaround as mentioned at https://github.com/actions/virtual-environments/issues/1499#issuecomment-689467080
# -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
- name: Check
run: mvn --batch-mode --update-snapshots -Drelease -DskipTests install
- name: Build
run: |
mvn --batch-mode -Drelease -DclickhouseVersion=${{ matrix.clickhouse }} -Dprotocol=${{ matrix.protocol }} verify
- name: Upload test results
uses: actions/upload-artifact@v2
if: failure()
with:
name: result ${{ github.job }}
path: |
**/target/failsafe-reports
**/target/surefire-reports