Skip to content

Adding cloud tests #1574

Adding cloud tests

Adding cloud tests #1574

Workflow file for this run

name: Analysis
on:
push:
branches:
- main
paths-ignore:
- "**.md"
- "**/docs/**"
- "**/LICENSE"
- "**/NOTICE"
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
paths-ignore:
- "**.md"
- "**/docs/**"
- "**/LICENSE"
- "**/NOTICE"
workflow_dispatch:
inputs:
pr:
description: "Pull request#"
required: false
env:
PREFERRED_LTS_VERSION: "24.3"
jobs:
static:
runs-on: ubuntu-latest
timeout-minutes: 15
name: Static code analysis
steps:
- name: Check out Git repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check out head
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
if: github.event_name == 'pull_request'
- name: Check out PR
run: |
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 \
origin pull/${{ github.event.inputs.pr }}/head:the-pr && git checkout the-pr
if: github.event.inputs.pr != ''
- name: Install JDK and Maven
uses: actions/setup-java@v3
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: Cache SonarCloud packages
uses: actions/cache@v2
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Update sonar config
run: |
sed -i -e 's|^\(.*<sonar.projectKey>\).*\(</sonar.projectKey>\)$|\1ClickHouse_clickhouse-jdbc\2|' \
-e 's|^\(.*<sonar.organization>\).*\(</sonar.organization>\)$|\1clickhouse-java\2|' pom.xml
if: github.repository_owner == 'ClickHouse'
- name: Build and install
run: |
find . -type f -name "simplelogger.*" -exec rm -fv '{}' \;
mvn -q --batch-mode --projects '!clickhouse-benchmark' -DclickhouseVersion=$PREFERRED_LTS_VERSION \
-DskipTests install
- name: Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
mvn --batch-mode --projects '!clickhouse-benchmark' -DclickhouseVersion=$PREFERRED_LTS_VERSION \
-Panalysis verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
continue-on-error: true