diff --git a/.github/workflows/code_analysis.yml b/.github/workflows/code_analysis.yml index 0e9cab29b..7ea1f2aac 100644 --- a/.github/workflows/code_analysis.yml +++ b/.github/workflows/code_analysis.yml @@ -9,29 +9,7 @@ on: - "docs/**" jobs: - is_java_project: - runs-on: ubuntu-latest - outputs: - pom_exists: ${{ steps.check_files.outputs.files_exists }} - checkstyle_active: ${{ steps.check_checkstyle.outputs.checkstyle_active }} - spotbugs_active: ${{ steps.check_spotbugs.outputs.spotbugs_active }} - steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Check file existence - id: check_files - uses: andstor/file-existence-action@v2 - with: - files: "pom.xml" - - name: check_checkstyle - id: check_checkstyle - run: echo "checkstyle_active=$(if grep -q "maven-checkstyle-plugin" pom.xml; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT - - name: check_spotbugs - id: check_spotbugs - run: echo "spotbugs_active=$(if grep -q "spotbugs-maven-plugin" pom.xml; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT run_checkstyle: - needs: [is_java_project] - if: needs.is_java_project.outputs.pom_exists == 'true' && needs.is_java_project.outputs.checkstyle_active == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -40,20 +18,6 @@ jobs: with: distribution: "temurin" java-version: "17" - cache: "maven" + cache: "gradle" - name: Run style checks - run: mvn -B checkstyle:check --file pom.xml - run_spotbugs: - needs: [is_java_project] - if: needs.is_java_project.outputs.pom_exists == 'true' && needs.is_java_project.outputs.spotbugs_active == 'true' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 - with: - distribution: "temurin" - java-version: "17" - cache: "maven" - - name: Run static code analysis - run: mvn -B compile spotbugs:check --file pom.xml + run: ./gradlew checkstyleMain checkstyleTest diff --git a/build.gradle.kts b/build.gradle.kts index 2f094e0d3..db2bb2e24 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -67,6 +67,8 @@ allprojects { configFile = rootProject.file("docs/dev/checkstyle/checkstyle-config.xml") configDirectory.set(rootProject.file("docs/dev/checkstyle")) maxErrors = 0 // does not tolerate errors + maxWarnings = 0 + sourceSets = emptySet() } repositories {