From 4e0446cdf75f99a011b11ccb050fc59bb6b02547 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Tue, 21 May 2024 19:50:29 +0200 Subject: [PATCH] Enable quality monitor. --- .github/workflows/quality-monitor.yml | 114 ++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 .github/workflows/quality-monitor.yml diff --git a/.github/workflows/quality-monitor.yml b/.github/workflows/quality-monitor.yml new file mode 100644 index 0000000..b3f0073 --- /dev/null +++ b/.github/workflows/quality-monitor.yml @@ -0,0 +1,114 @@ +name: 'Quality Monitor PR' + +on: + pull_request_target: + +jobs: + build: + + runs-on: [ubuntu-latest] + name: Build, test and monitor quality on Ubuntu + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 21 + check-latest: true + cache: 'maven' + - name: Set up Maven + uses: stCarolas/setup-maven@v5 + with: + maven-version: 3.9.6 + - name: Build with Maven + env: + BROWSER: chrome-container + run: mvn -V --color always -ntp clean verify -Ppit -Pci | tee maven.log + - name: Extract pull request number + uses: jwalton/gh-find-current-pr@v1 + id: pr + - name: Run Quality Monitor + uses: uhafner/quality-monitor@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + pr-number: ${{ steps.pr.outputs.number }} + config: > + { + "tests": { + "name": "Tests", + "tools": [ + { + "id": "test", + "name": "Tests", + "pattern": "**/target/*-reports/TEST*.xml" + } + ] + }, + "analysis": [ + { + "name": "Style", + "id": "style", + "tools": [ + { + "id": "checkstyle", + "pattern": "**/target/checkstyle-*/checkstyle-result.xml" + }, + { + "id": "pmd", + "pattern": "**/target/pmd-*/pmd.xml" + } + ] + }, + { + "name": "Bugs", + "id": "bugs", + "icon": "bug", + "tools": [ + { + "id": "spotbugs", + "sourcePath": "src/main/java", + "pattern": "**/target/spotbugsXml.xml" + }, + { + "id": "error-prone", + "pattern": "**/maven.log" + } + ] + } + ], + "coverage": [ + { + "name": "Code Coverage", + "tools": [ + { + "id": "jacoco", + "name": "Line Coverage", + "metric": "line", + "sourcePath": "src/main/java", + "pattern": "**/target/site/jacoco/jacoco.xml" + }, + { + "id": "jacoco", + "name": "Branch Coverage", + "metric": "branch", + "sourcePath": "src/main/java", + "pattern": "**/target/site/jacoco/jacoco.xml" + } + ] + }, + { + "name": "Mutation Coverage", + "tools": [ + { + "id": "pit", + "name": "Mutation Coverage", + "metric": "mutation", + "sourcePath": "src/main/java", + "pattern": "**/target/pit-reports/mutations.xml" + } + ] + } + ] + }