2022-11-17 06:50:16 -05:00
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership.
|
|
|
|
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
# (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
name: Static Checks CI
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- /^\d+\.\d+\.\d+(-\S*)?$/ # release branches
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- /^\d+\.\d+\.\d+(-\S*)?$/ # release branches
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
env:
|
|
|
|
MVN: mvn -B
|
|
|
|
MAVEN_SKIP: -P skip-static-checks -Dweb.console.skip=true -Dmaven.javadoc.skip=true
|
|
|
|
MAVEN_SKIP_TESTS: -P skip-tests
|
|
|
|
MAVEN_OPTS: -Xmx3000m
|
|
|
|
|
|
|
|
jobs:
|
2022-12-02 04:36:31 -05:00
|
|
|
static-checks:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
java: [ 'jdk8', 'jdk11', 'jdk17' ]
|
2022-11-17 06:50:16 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-12-02 04:36:31 -05:00
|
|
|
- name: checkout branch
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: set java version
|
|
|
|
run: |
|
|
|
|
export jdk=${{ matrix.java }}
|
|
|
|
echo "java_version=${jdk:3}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: setup ${{ matrix.java }}
|
2022-11-17 06:50:16 -05:00
|
|
|
uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
distribution: 'zulu'
|
2022-12-02 04:36:31 -05:00
|
|
|
java-version: ${{ env.java_version }}
|
2022-11-17 06:50:16 -05:00
|
|
|
cache: 'maven'
|
2022-12-02 04:36:31 -05:00
|
|
|
|
|
|
|
- name: packaging check
|
|
|
|
run: |
|
|
|
|
./.github/scripts/setup_generate_license.sh
|
|
|
|
${MVN} clean install -Prat -Pdist -Pbundle-contrib-exts --fail-at-end \
|
|
|
|
-pl '!benchmarks' ${MAVEN_SKIP} ${MAVEN_SKIP_TESTS} -Dweb.console.skip=false -T1C
|
|
|
|
|
|
|
|
- name: script checks
|
|
|
|
# who watches the watchers?
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
run: ./check_test_suite_test.py
|
|
|
|
|
|
|
|
- name: (openjdk11) strict compilation
|
|
|
|
if: ${{ matrix.java == 'jdk11' }}
|
|
|
|
# errorprone requires JDK 11
|
|
|
|
# Strict compilation requires more than 2 GB
|
|
|
|
run: ${MVN} clean -DstrictCompile compile test-compile --fail-at-end ${MAVEN_SKIP} ${MAVEN_SKIP_TESTS}
|
|
|
|
|
|
|
|
- name: maven install
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
run: |
|
2022-11-17 06:50:16 -05:00
|
|
|
echo 'Running Maven install...' &&
|
|
|
|
${MVN} clean install -q -ff -pl '!distribution,!:druid-it-image,!:druid-it-cases' ${MAVEN_SKIP} ${MAVEN_SKIP_TESTS} -T1C &&
|
|
|
|
${MVN} install -q -ff -pl 'distribution' ${MAVEN_SKIP} ${MAVEN_SKIP_TESTS}
|
|
|
|
|
2022-12-06 01:38:03 -05:00
|
|
|
- name: license checks
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
run: ./.github/scripts/license_checks_script.sh
|
|
|
|
|
|
|
|
- name: license checks for hadoop3
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
env:
|
|
|
|
HADOOP_PROFILE: -Phadoop3
|
|
|
|
run: ./.github/scripts/license_checks_script.sh
|
|
|
|
|
|
|
|
- name: analyze dependencies
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
run: |
|
|
|
|
./.github/scripts/analyze_dependencies_script.sh
|
|
|
|
|
|
|
|
- name: analyze dependencies for hadoop3
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
env:
|
|
|
|
HADOOP_PROFILE: -Phadoop3
|
|
|
|
run: |
|
|
|
|
./.github/scripts/analyze_dependencies_script.sh
|
|
|
|
|
2022-12-02 04:36:31 -05:00
|
|
|
- name: animal sniffer checks
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
run: ${MVN} animal-sniffer:check --fail-at-end
|
2022-11-17 06:50:16 -05:00
|
|
|
|
2022-12-02 04:36:31 -05:00
|
|
|
- name: checkstyle
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
run: ${MVN} checkstyle:checkstyle --fail-at-end
|
2022-11-17 06:50:16 -05:00
|
|
|
|
2022-12-02 04:36:31 -05:00
|
|
|
- name: enforcer checks
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
run: ${MVN} enforcer:enforce --fail-at-end
|
2022-11-17 06:50:16 -05:00
|
|
|
|
2022-12-02 04:36:31 -05:00
|
|
|
- name: forbidden api checks
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
run: ${MVN} forbiddenapis:check forbiddenapis:testCheck --fail-at-end
|
2022-11-17 06:50:16 -05:00
|
|
|
|
2022-12-02 04:36:31 -05:00
|
|
|
- name: pmd checks
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
run: ${MVN} pmd:check --fail-at-end # TODO: consider adding pmd:cpd-check
|
2022-11-17 06:50:16 -05:00
|
|
|
|
2022-12-02 04:36:31 -05:00
|
|
|
- name: spotbugs checks
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
run: ${MVN} spotbugs:check --fail-at-end -pl '!benchmarks'
|
2022-11-17 06:50:16 -05:00
|
|
|
|
2022-12-02 04:36:31 -05:00
|
|
|
- name: intellij inspections
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
run: |
|
|
|
|
docker run --rm \
|
|
|
|
-v $(pwd):/project \
|
|
|
|
-v ~/.m2:/home/inspect/.m2 \
|
|
|
|
ccaominh/intellij-inspect:1.0.0 \
|
|
|
|
/project/pom.xml \
|
|
|
|
/project/.idea/inspectionProfiles/Druid.xml \
|
|
|
|
--levels ERROR \
|
|
|
|
--scope JavaInspectionsScope
|
2022-11-17 06:50:16 -05:00
|
|
|
|
2022-12-02 04:36:31 -05:00
|
|
|
- name: setup node
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
uses: actions/setup-node@v3
|
2022-11-17 06:50:16 -05:00
|
|
|
with:
|
2022-12-02 04:36:31 -05:00
|
|
|
node-version: 16.17.0
|
2022-11-17 06:50:16 -05:00
|
|
|
|
2022-12-02 04:36:31 -05:00
|
|
|
- name: docs
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
run: |
|
|
|
|
(cd website && npm install)
|
|
|
|
cd website
|
|
|
|
npm run link-lint
|
|
|
|
npm run spellcheck
|
2022-11-17 06:50:16 -05:00
|
|
|
|
2022-12-02 04:36:31 -05:00
|
|
|
- name: web console
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
run: |
|
|
|
|
${MVN} test -pl 'web-console'
|
|
|
|
cd web-console
|
|
|
|
{ for i in 1 2 3; do npm run codecov && break || sleep 15; done }
|
|
|
|
|
|
|
|
- name: web console end-to-end test
|
|
|
|
if: ${{ matrix.java == 'jdk8' }}
|
|
|
|
run: |
|
|
|
|
./.github/scripts/setup_generate_license.sh
|
|
|
|
sudo apt-get update && sudo apt-get install python3 -y
|
|
|
|
curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | sudo -H python3
|
|
|
|
pip3 install wheel # install wheel first explicitly
|
|
|
|
pip3 install --upgrade pyyaml
|
|
|
|
web-console/script/druid build
|
|
|
|
web-console/script/druid start
|
|
|
|
(cd web-console && npm run test-e2e)
|
|
|
|
web-console/script/druid stop
|