From fa3e04148d1d635736f81289fb3932f3fe3a8f04 Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Fri, 1 Dec 2023 14:40:39 +0100 Subject: [PATCH] Add autograding to CI. --- .github/workflows/ci.yml | 91 +++++++++++++++++++++++++++++++++ .github/workflows/reporting.yml | 8 +-- 2 files changed, 92 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0e8eb0c..fcd7ab9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,3 +35,94 @@ jobs: env: BROWSER: chrome-container run: mvn -V --color always -ntp clean verify --file pom.xml '-Djenkins.test.timeout=5000' '-Dgpg.skip' + - 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", + "pattern": "**/target/spotbugsXml.xml" + } + + ], + "errorImpact": -1, + "highImpact": -1, + "normalImpact": -1, + "lowImpact": -1, + "maxScore": 100 + }, + "coverage": [ + { + "tools": [ + { + "id": "jacoco", + "name": "Line Coverage", + "metric": "line", + "pattern": "**/target/site/jacoco/jacoco.xml" + }, + { + "id": "jacoco", + "name": "Branch Coverage", + "metric": "branch", + "pattern": "**/target/site/jacoco/jacoco.xml" + } + ], + "name": "JaCoCo", + "maxScore": 100, + "missedPercentageImpact": -1 + }, + { + "tools": [ + { + "id": "pit", + "name": "Mutation Coverage", + "metric": "mutation", + "pattern": "**/target/pit-reports/mutations.xml" + } + ], + "name": "PIT", + "maxScore": 100, + "missedPercentageImpact": -1 + } + ] + } diff --git a/.github/workflows/reporting.yml b/.github/workflows/reporting.yml index 8d77e76c..9625ad9e 100644 --- a/.github/workflows/reporting.yml +++ b/.github/workflows/reporting.yml @@ -4,10 +4,7 @@ on: push: branches: - main - pull_request: - branches: - - master - - main + jobs: coverage: @@ -16,8 +13,6 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: jwalton/gh-find-current-pr@v1 - id: pr - name: Set up JDK 21 uses: actions/setup-java@v4 with: @@ -39,7 +34,6 @@ jobs: uses: uhafner/autograding-github-action@v3 with: github-token: ${{ secrets.GITHUB_TOKEN }} - pr-number: ${{ steps.pr.outputs.number }} checks-name: 'Grading Badges' config: > {