Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 8 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,30 @@ on:
branches:
- master
- develop
- 0.2.x
paths-ignore:
- "CHANGELOG"
- "**.md"
- "docs/**"
- "**/CHANGELOG"

pull_request:
types:
- opened
- synchronize
- reopened
paths-ignore:
- "CHANGELOG"
- "**.md"
- "docs/**"
- "**/CHANGELOG"

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [8, 9, 11]
# most recent LTS releases and latest stable build
clickhouse: ["19.14", "20.3", "20.8", "latest"]
java: [8, 11]
# most recent LTS releases as well as latest stable builds
clickhouse: ["19.14", "20.3", "20.8", "20.10", "20.12", "21.2", "latest"]
name: Build using JDK ${{ matrix.java }} against ClickHouse ${{ matrix.clickhouse }}
steps:
- name: Check out Git repository
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
version:
description: "Release version"
required: true
default: "0.2.6-SNAPSHOT"
default: "0.3.0-SNAPSHOT"

jobs:
release:
Expand All @@ -19,13 +19,14 @@ jobs:
- name: Install Java and Maven
uses: actions/setup-java@v1
with:
java-version: 1.8
- run: sed -i -e 's|^\( <version>\).*\(</version>\)$|\1${{ github.event.inputs.version }}\2|' pom.xml
java-version: 8
- run: find . -type f -name "pom.xml" -exec sed -i -e 's|${revision}|${{ github.event.inputs.version }}|g' -e 's|${parent.groupId}|tech.clickhouse|g' '{}' \;
- run: find . -type f -name "log4j.properties" -exec sed -i -e 's|DEBUG|WARN|g' '{}' \;
- name: Release Maven package
uses: samuelmeuli/action-maven-publish@v1
with:
maven_profiles: release
maven_args: --batch-mode
maven_args: -q --batch-mode
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
nexus_username: ${{ secrets.SONATYPE_USER }}
Expand Down
115 changes: 109 additions & 6 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,126 @@ on:
pr:
description: "Pull request#"
required: false
pull_request:
types:
- opened
- synchronize
- reopened
paths-ignore:
- "**.md"
- "docs/**"
- "**/CHANGELOG"
issue_comment:
types:
- created
- edited

jobs:
verify:
verify-commented-pr:
runs-on: ubuntu-latest
name: Verify branch/PR using JDK ${{ github.event.inputs.java }} against ClickHouse ${{ github.event.inputs.clickhouse }}
name: Verify commented PR
if: github.event_name == 'issue_comment' && github.event.issue.pull_request
steps:
- uses: zhicwu/pull-request-comment-trigger@master
id: check
with:
trigger: '@verify'
reaction: rocket
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- name: Extra parameters from PR comment
if: steps.check.outputs.triggered == 'true'
uses: actions/github-script@v3
id: commented
env:
COMMENT_BODY: '${{ github.event.comment.body }}'
with:
script: |
const keyword = '@verify';
let buildArgs = process.env.COMMENT_BODY;
core.info(`Got commented body: ${buildArgs}`);
buildArgs = buildArgs.substring(buildArgs.lastIndexOf(keyword) + keyword.length);
const args = buildArgs.match(/[^\s]+/g);
core.info(`Got commented arguments: ${args}`);

return {
pr: context.issue.number,
clickhouse: args && args.length > 0 ? args[0] : "latest",
java: args && args.length > 1 ? args[1] : "8"
};
- name: Check out repository
uses: actions/checkout@v2
if: github.event.inputs.pr == ''
- name: Check out PR ${{ github.event.inputs.pr }}
- name: Check out commented PR
if: steps.check.outputs.triggered == 'true'
run: |
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin pull/${{ fromJSON(steps.commented.outputs.result).pr }}/merge:merged-pr && git checkout merged-pr
- name: Set up JDK
if: steps.check.outputs.triggered == 'true'
uses: actions/setup-java@v1
with:
java-version: ${{ fromJSON(steps.commented.outputs.result).java }}
continue-on-error: true
- name: Verify with Maven
if: steps.check.outputs.triggered == 'true'
run: mvn --batch-mode --update-snapshots -DclickhouseVersion=${{ fromJSON(steps.commented.outputs.result).clickhouse }} verify
id: maven
continue-on-error: true
- name: Comment PR
uses: actions/github-script@v3
if: steps.check.outputs.triggered == 'true'
env:
CLICKHOUSE_VRESION: ${{ fromJSON(steps.commented.outputs.result).clickhouse }}
JAVA_VERSION: ${{ fromJSON(steps.commented.outputs.result).java }}
PREV_STEP_RESULT: '${{ steps.maven.outcome }}'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
const result = process.env.PREV_STEP_RESULT;
const buildUrl = `https://github.com/${owner}/${repo}/actions/runs/${context.runId}`;
const flag = result === 'success'
? ':green_circle:'
: (result === 'failure' ? ':red_circle:' : ':yellow_circle:');
const msg = `${flag} verify using JDK [${process.env.JAVA_VERSION}] and ClickHouse [${process.env.CLICKHOUSE_VRESION}]: [${result}](${buildUrl})`;
github.issues.createComment({ issue_number, owner, repo, body: msg });

verify-on-demand:
runs-on: ubuntu-latest
name: Verify on demand
if: github.event_name == 'workflow_dispatch'
steps:
- name: Check out 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 != ''
with:
ref: refs/remotes/pull/${{ github.event.inputs.pr }}/merge
- name: Set up JDK ${{ github.event.inputs.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ github.event.inputs.java }}
continue-on-error: true
- name: Verify with Maven
run: mvn --batch-mode --update-snapshots -DclickhouseVersion=${{ github.event.inputs.clickhouse }} verify
id: maven
continue-on-error: true
- name: 'Comment PR'
uses: actions/github-script@v3
if: github.event.inputs.pr != ''
env:
PR_NO: ${{ github.event.inputs.pr }}
CLICKHOUSE_VRESION: ${{ github.event.inputs.clickhouse }}
JAVA_VERSION: ${{ github.event.inputs.java }}
PREV_STEP_RESULT: '${{ steps.maven.outcome }}'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issue_number = process.env.PR_NO;
const { repo: { owner, repo } } = context;
const result = process.env.PREV_STEP_RESULT;
const buildUrl = `https://github.com/${owner}/${repo}/actions/runs/${context.runId}`;
const flag = result === 'success'
? ':green_circle:'
: (result === 'failure' ? ':red_circle:' : ':yellow_circle:');
const msg = `${flag} verify using JDK [${process.env.JAVA_VERSION}] and ClickHouse [${process.env.CLICKHOUSE_VRESION}]: [${result}](${buildUrl})`;
github.issues.createComment({ issue_number, owner, repo, body: msg });