Skip to content

Commit

Permalink
Set up the assignment project for summer 2025
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Feb 28, 2025
1 parent c765253 commit 1f393ca
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 36 deletions.
123 changes: 123 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
workflow:
name: CI
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'

image:
name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/maven:3.9.9-eclipse-temurin-21-alpine

stages:
- build
- test
- grade

build:
stage: build
artifacts:
when: always
paths:
- target
script:
- mvn -V --color always -ntp -fae test-compile -Pci

test:
stage: test
needs:
- analysis
artifacts:
when: always
paths:
- target
script:
- mvn -V --color always -ntp -fae verify -Pci

autograding:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/uhafner/autograding-gitlab-action:v3
stage: grade
when: always
script:
- java -cp @/app/jib-classpath-file edu.hm.hafner.grading.gitlab.GitLabAutoGradingRunner
variables:
MAX_WARNING_COMMENTS: 10
MAX_COVERAGE_COMMENTS: 10
CONFIG: |
{
"tests": {
"name": "Tests",
"tools": [
{
"id": "junit",
"name": "Tests",
"pattern": "**/target/*-reports/TEST*.xml"
}
],
"passedImpact": 0,
"skippedImpact": -1,
"failureImpact": -5,
"maxScore": 100
},
"analysis": [
{
"name": "Style",
"id": "style",
"tools": [
{
"id": "checkstyle",
"name": "CheckStyle",
"pattern": "**/target/**checkstyle-result.xml"
},
{
"id": "pmd",
"name": "PMD",
"pattern": "**/target/**pmd.xml"
}
],
"errorImpact": -1,
"highImpact": -1,
"normalImpact": -1,
"lowImpact": -1,
"maxScore": 100
},
{
"name": "Bugs",
"id": "bugs",
"icon": "bug",
"tools": [
{
"id": "spotbugs",
"name": "SpotBugs",
"sourcePath": "src/main/java",
"pattern": "**/target/**spotbugsXml.xml"
}
],
"errorImpact": -3,
"highImpact": -3,
"normalImpact": -3,
"lowImpact": -3,
"maxScore": 100
}
],
"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"
}
],
"maxScore": 100,
"missedPercentageImpact": -1
}
]
}
41 changes: 6 additions & 35 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<parent>
<artifactId>codingstyle-pom</artifactId>
<groupId>edu.hm.hafner</groupId>
<version>3.39.0</version>
<version>5.12.0</version>
</parent>

<artifactId>java2-assignment1</artifactId>
<version>2023-S-SNAPSHOT</version>
<version>2025-S-SNAPSHOT</version>

<packaging>jar</packaging>

Expand All @@ -28,18 +28,19 @@

<developers>
<developer>
<name>Ullrich Hafner</name>
<id>uhafner</id>
<name>Ullrich Hafner</name>
<email>ullrich.hafner@hm.edu</email>
<url>https://cs.hm.edu/~hafner</url>
<organization>Munich University of Applied Sciences</organization>
<organizationUrl>https://www.hm.edu/en/index.en.html</organizationUrl>
</developer>
</developers>

<url>http://www.cs.hm.edu/die_fakultaet/ansprechpartner/professoren/hafner/index.de.html</url>
<url>https://cs.hm.edu/~hafner</url>

<properties>
<java.version>17</java.version>
<java.version>21</java.version>
<source.encoding>UTF-8</source.encoding>
<project.build.sourceEncoding>${source.encoding}</project.build.sourceEncoding>

Expand All @@ -61,7 +62,6 @@
</properties>

<build>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -146,35 +146,6 @@
</executions>
</plugin>
</plugins>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>${maven-pitest-plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-junit5-plugin</artifactId>
<version>${pitest-junit5-plugin.version}</version>
</dependency>
</dependencies>
<configuration>
<failWhenNoMutations>false</failWhenNoMutations>
<outputFormats>XML,HTML</outputFormats>
<excludedTestClasses>
<param>*ITest</param>
</excludedTestClasses>
<excludedMethods>
<param>*equals</param>
<param>*hashCode</param>
<param>*toString</param>
</excludedMethods>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>
2 changes: 1 addition & 1 deletion src/main/java/edu/hm/hafner/java2/assignment1/Exam.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
/**
* An exam contains several assignments.
*/
public class Exam {
public class Exam {
}

0 comments on commit 1f393ca

Please sign in to comment.