Skip to content

Commit

Permalink
Configure caching for static-check actions (#15010)
Browse files Browse the repository at this point in the history
* some stuff

* some stuff

* dont change it.sh

* some stuff

* updates

* add missing

* add 1 more

* setup-java
  • Loading branch information
kgyrtkirk authored Sep 20, 2023
1 parent 823f620 commit 08cf290
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 27 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
cache: 'maven'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand All @@ -42,7 +48,6 @@ jobs:
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
queries: +security-and-quality


- run: |
echo "Building using custom commands"
mvn clean package -f "pom.xml" -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Denforcer.skip -Dmaven.javadoc.skip -DskipTests -Dmaven.test.skip.exec -Dlicense.skip=true -Dweb.console.skip=true -Dcyclonedx.skip=true
Expand Down
53 changes: 27 additions & 26 deletions .github/workflows/static-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,17 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ 'jdk8', 'jdk11', 'jdk17' ]
java: [ '8', '11', '17' ]
runs-on: ubuntu-latest
steps:
- 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 }}
run: |
echo "JAVA_HOME=$JAVA_HOME_${{ env.java_version }}_X64" >> $GITHUB_ENV
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
cache: 'maven'

- name: packaging check
run: |
Expand All @@ -66,53 +63,53 @@ jobs:
- name: script checks
# who watches the watchers?
if: ${{ matrix.java == 'jdk8' }}
if: ${{ matrix.java == '8' }}
run: ./check_test_suite_test.py

- name: (openjdk17) strict compilation
if: ${{ matrix.java == 'jdk17' }}
if: ${{ matrix.java == '17' }}
# 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' }}
if: ${{ matrix.java == '8' }}
run: |
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}
- name: checkstyle
if: ${{ matrix.java == 'jdk8' }}
if: ${{ matrix.java == '8' }}
run: ${MVN} checkstyle:checkstyle --fail-at-end

- name: license checks
if: ${{ matrix.java == 'jdk8' }}
if: ${{ matrix.java == '8' }}
run: ./.github/scripts/license_checks_script.sh

- name: analyze dependencies
if: ${{ matrix.java == 'jdk8' }}
if: ${{ matrix.java == '8' }}
run: |
./.github/scripts/analyze_dependencies_script.sh
- name: animal sniffer checks
if: ${{ matrix.java == 'jdk8' }}
if: ${{ matrix.java == '8' }}
run: ${MVN} animal-sniffer:check --fail-at-end

- name: enforcer checks
if: ${{ matrix.java == 'jdk8' }}
if: ${{ matrix.java == '8' }}
run: ${MVN} enforcer:enforce --fail-at-end

- name: forbidden api checks
if: ${{ matrix.java == 'jdk8' }}
if: ${{ matrix.java == '8' }}
run: ${MVN} forbiddenapis:check forbiddenapis:testCheck --fail-at-end

- name: pmd checks
if: ${{ matrix.java == 'jdk8' }}
if: ${{ matrix.java == '8' }}
run: ${MVN} pmd:check --fail-at-end # TODO: consider adding pmd:cpd-check

- name: spotbugs checks
if: ${{ matrix.java == 'jdk8' }}
if: ${{ matrix.java == '8' }}
run: ${MVN} spotbugs:check --fail-at-end -pl '!benchmarks'

intellij-inspections:
Expand All @@ -123,9 +120,11 @@ jobs:
- name: checkout branch
uses: actions/checkout@v3

- name: setup JDK8
run: |
echo "JAVA_HOME=$JAVA_HOME_8_X64" >> $GITHUB_ENV
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
cache: 'maven'

- name: maven install
run: |
Expand Down Expand Up @@ -153,9 +152,11 @@ jobs:
- name: checkout branch
uses: actions/checkout@v3

- name: setup JDK17
run: |
echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: 'maven'

- name: setup node
uses: actions/setup-node@v3
Expand Down

0 comments on commit 08cf290

Please sign in to comment.