Skip to content

Commit

Permalink
Merge pull request #350 from uhafner/quality-monitor
Browse files Browse the repository at this point in the history
Use quality monitor in CI
  • Loading branch information
uhafner committed May 20, 2024
2 parents 64ca3d0 + a869e5f commit 5b496b4
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 43 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/autograding.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
env:
DOCKER_IO_USERNAME: ${{ secrets.DOCKER_IO_USERNAME }}
DOCKER_IO_PASSWORD: ${{ secrets.DOCKER_IO_PASSWORD }}
run: mvn -ntp clean install
run: mvn -ntp clean install -Pci
7 changes: 2 additions & 5 deletions .github/workflows/dogfood.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ jobs:
"tools": [
{
"id": "test",
"name": "Unittests",
"pattern": "**/src/test/resources/**/TEST*.xml"
}
],
"name": "JUnit",
"name": "Tests",
"passedImpact": 10,
"skippedImpact": -1,
"failureImpact": -5,
Expand All @@ -51,7 +50,6 @@ jobs:
"tools": [
{
"id": "checkstyle",
"name": "CheckStyle",
"pattern": "**/src/test/resources/**/checkstyle*.xml"
},
{
Expand All @@ -73,7 +71,6 @@ jobs:
"tools": [
{
"id": "spotbugs",
"name": "SpotBugs",
"pattern": "**/src/test/resources/**/spotbugs*.xml"
}
],
Expand Down Expand Up @@ -138,7 +135,7 @@ jobs:
with:
maven-version: 3.9.6
- name: Build
run: mvn -ntp clean verify -Ppit -Pdepgraph
run: mvn -ntp clean verify -Pci -Ppit -Pdepgraph
- name: Run Autograding
uses: uhafner/autograding-github-action@main
with:
Expand Down
114 changes: 114 additions & 0 deletions .github/workflows/quality-monitor.yml
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
]
}

0 comments on commit 5b496b4

Please sign in to comment.