From a3ecb63d9dd80520493fa8b1a861964972d2b55b Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Wed, 20 Dec 2023 11:48:28 +0100 Subject: [PATCH 1/3] Enable the quality monitor. --- .github/workflows/autograding.yml | 124 -------------------------- .github/workflows/quality-monitor.yml | 36 ++++++++ 2 files changed, 36 insertions(+), 124 deletions(-) delete mode 100644 .github/workflows/autograding.yml create mode 100644 .github/workflows/quality-monitor.yml diff --git a/.github/workflows/autograding.yml b/.github/workflows/autograding.yml deleted file mode 100644 index b3a0ca2d..00000000 --- a/.github/workflows/autograding.yml +++ /dev/null @@ -1,124 +0,0 @@ -name: 'Autograding PR' - -on: - pull_request: - -jobs: - build: - - runs-on: [ubuntu-latest] - name: Build, test and autograde 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@v4.5 - with: - maven-version: 3.9.5 - - name: Build with Maven - env: - BROWSER: chrome-container - run: mvn -V --color always -ntp clean verify --file pom.xml '-Djenkins.test.timeout=5000' '-Dgpg.skip' -Ppit | tee maven.log - - name: Extract pull request number - uses: jwalton/gh-find-current-pr@v1 - id: pr - - name: Run Autograding - uses: uhafner/autograding-github-action@v3 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - pr-number: ${{ steps.pr.outputs.number }} - checks-name: 'Quality Checks' - config: > - { - "tests": { - "tools": [ - { - "id": "test", - "name": "Unittests", - "pattern": "**/target/*-reports/TEST*.xml" - } - ], - "name": "JUnit", - "passedImpact": 0, - "skippedImpact": -1, - "failureImpact": -5, - "maxScore": 100 - }, - "analysis": { - "name": "Warnings", - "id": "warnings", - "tools": [ - { - "id": "checkstyle", - "name": "CheckStyle", - "pattern": "**/target/checkstyle-result.xml" - }, - { - "id": "pmd", - "name": "PMD", - "pattern": "**/target/pmd.xml" - }, - { - "id": "error-prone", - "name": "Error Prone", - "pattern": "**/maven.log" - }, - { - "id": "spotbugs", - "name": "SpotBugs", - "sourcePath": "src/main/java", - "pattern": "**/target/spotbugsXml.xml" - } - - ], - "errorImpact": -1, - "highImpact": -1, - "normalImpact": -1, - "lowImpact": -1, - "maxScore": 100 - }, - "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": "JaCoCo", - "maxScore": 100, - "missedPercentageImpact": -1 - }, - { - "tools": [ - { - "id": "pit", - "name": "Mutation Coverage", - "metric": "mutation", - "sourcePath": "src/main/java", - "pattern": "**/target/pit-reports/mutations.xml" - } - ], - "name": "PIT", - "maxScore": 100, - "missedPercentageImpact": -1 - } - ] - } diff --git a/.github/workflows/quality-monitor.yml b/.github/workflows/quality-monitor.yml new file mode 100644 index 00000000..970af739 --- /dev/null +++ b/.github/workflows/quality-monitor.yml @@ -0,0 +1,36 @@ +name: 'Quality Monitor PR' + +on: + pull_request: + +jobs: + build: + + runs-on: [ubuntu-latest] + name: Build and test 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@v4.5 + with: + maven-version: 3.9.5 + - name: Build with Maven + env: + BROWSER: chrome-container + run: mvn -V --color always -ntp clean verify --file pom.xml '-Djenkins.test.timeout=5000' '-Dgpg.skip' -Ppit | tee maven.log + - name: Extract pull request number + uses: jwalton/gh-find-current-pr@v1 + id: pr + - name: Run Autograding + uses: uhafner/quality-monitor@main + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + pr-number: ${{ steps.pr.outputs.number }} From 9c8950f619905f465f1f19d2761d7004d5d1e700 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Wed, 20 Dec 2023 12:01:52 +0100 Subject: [PATCH 2/3] Enable the quality monitor. --- .github/workflows/quality-monitor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/quality-monitor.yml b/.github/workflows/quality-monitor.yml index 970af739..eaecb1ae 100644 --- a/.github/workflows/quality-monitor.yml +++ b/.github/workflows/quality-monitor.yml @@ -33,4 +33,5 @@ jobs: uses: uhafner/quality-monitor@main with: github-token: ${{ secrets.GITHUB_TOKEN }} + checks-name: 'Quality Monitor' pr-number: ${{ steps.pr.outputs.number }} From 844b406338ea4aa3caddebaa7be9796acaa59440 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Wed, 20 Dec 2023 17:07:45 +0100 Subject: [PATCH 3/3] Improve build script. --- .github/workflows/quality-monitor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/quality-monitor.yml b/.github/workflows/quality-monitor.yml index eaecb1ae..7b2da1a0 100644 --- a/.github/workflows/quality-monitor.yml +++ b/.github/workflows/quality-monitor.yml @@ -25,7 +25,7 @@ jobs: - name: Build with Maven env: BROWSER: chrome-container - run: mvn -V --color always -ntp clean verify --file pom.xml '-Djenkins.test.timeout=5000' '-Dgpg.skip' -Ppit | tee maven.log + run: mvn -V --color always -ntp clean verify -Ppit | tee maven.log - name: Extract pull request number uses: jwalton/gh-find-current-pr@v1 id: pr