diff --git a/.github/workflows/autograding.yml b/.github/workflows/autograding.yml new file mode 100644 index 00000000..698d238b --- /dev/null +++ b/.github/workflows/autograding.yml @@ -0,0 +1,119 @@ +name: 'Autograding Pull Request' + +on: + pull_request: + +jobs: + build: + + runs-on: [ubuntu-latest] + name: Autograding Pull Request + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK ${{ matrix.jdk }} + 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 + - 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/ci.yml b/.github/workflows/ci.yml index fcd7ab9e..a0e8eb0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,94 +35,3 @@ 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 - } - ] - }