Skip to content

Commit

Permalink
Merge pull request #1 from uhafner/refactoring
Browse files Browse the repository at this point in the history
Refactoring: split model, UI and backend
  • Loading branch information
uhafner authored Sep 14, 2020
2 parents ba41349 + 4790f8f commit 1a0f7b3
Show file tree
Hide file tree
Showing 21 changed files with 882 additions and 654 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# github-actions-autograding

This actions plugin will build your project with Maven, parse the generated reports, grade the results and give feedback on the pull request.
# Autograding GitHub Action

This GitHub action autogrades your Java project with a customizable configuration and gives feedback on the
pull request.

### How to use?

Expand All @@ -28,5 +28,4 @@ jobs:
#### Configuration

- ``TOKEN: ThisIsSomeToken`` (mandatory) to change the token.
- ``CONFIG: /path/to/config`` or ``CONFIG: "{\"analysis\": { \"maxScore\": 100, \"errorImpact\": -5}}"`` to provide a config, defaults to /default.conf.
- ``DEBUG: true`` to enable debug.
- ``CONFIG: "{\"analysis\": { \"maxScore\": 100, \"errorImpact\": -5}}"`` to change the built in configuration.
15 changes: 5 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
name: Autograding Actions Plugin
description: Autograding Actions Plugin that evaluates code based on configurable quality critera.
name: Autograding Action
description: Action that autogrades assignments based on configurable quality critera.


inputs:
CONFIG:
description: "Autograding config."
description: "Autograding configuration"
required: false
default: "/default.conf"
TOKEN:
description: "GitHub token."
description: "GitHub token"
required: true
DEBUG:
description: "Enable debug if set."
required: false

runs:
using: 'docker'
image: 'Dockerfile'
env:
CONFIG: ${{ inputs.CONFIG }}
TOKEN: ${{ inputs.TOKEN }}
DEBUG: ${{ inputs.DEBUG }}

branding:
icon: check
color: red
color: red
10 changes: 5 additions & 5 deletions default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"analysis": {
"maxScore": 100,
"errorImpact": -5,
"highImpact": -2,
"normalImpact": -1,
"highImpact": -3,
"normalImpact": -2,
"lowImpact": -1
},
"tests": {
Expand All @@ -20,8 +20,8 @@
"pit": {
"maxScore": 100,
"detectedImpact": 0,
"undetectedImpact": -1,
"undetectedImpact": 0,
"detectedPercentageImpact": 0,
"undetectedPercentageImpact": 0
"undetectedPercentageImpact": -1
}
}
}
8 changes: 0 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
#!/bin/sh

# JUnit, CMD, Checkstyle, FindBugs
mvn -ntp -V -e clean verify -Dmaven.test.failure.ignore -Dgpg.skip
# Build with maven (pit)
mvn -ntp org.pitest:pitest-maven:mutationCoverage
# Build with maven (jacoco)
mvn -ntp -V -U -e jacoco:prepare-agent test jacoco:report -Dmaven.test.failure.ignore

# Get report
java -jar /target/github-actions-autograding-jar-with-dependencies.jar

179 changes: 90 additions & 89 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,104 +2,105 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>edu.hm.hafner</groupId>
<artifactId>codingstyle-pom</artifactId>
<version>1.1.1</version>
<relativePath/>
</parent>
<parent>
<groupId>edu.hm.hafner</groupId>
<artifactId>codingstyle-pom</artifactId>
<version>1.1.1</version>
<relativePath/>
</parent>

<groupId>de.tobiasmichael.me</groupId>
<artifactId>github-actions-autograding</artifactId>
<version>0.1</version>
<packaging>jar</packaging>
<groupId>edu.hm.hafner</groupId>
<artifactId>github-actions-autograding</artifactId>
<version>0.1</version>
<packaging>jar</packaging>

<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
<repository>
<id>incrementals.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/incrementals/</url>
</repository>
</repositories>
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
<repository>
<id>incrementals.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/incrementals/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>edu.hm.hafner</groupId>
<artifactId>autograding-model</artifactId>
<version>0.2.0</version>
</dependency>
<dependencies>
<dependency>
<groupId>edu.hm.hafner</groupId>
<artifactId>autograding-model</artifactId>
<version>0.2.0</version>
</dependency>

<dependency>
<groupId>edu.hm.hafner</groupId>
<artifactId>analysis-model</artifactId>
<version>9.0.0-rc3664.9498c6712d00</version>
</dependency>
<dependency>
<groupId>edu.hm.hafner</groupId>
<artifactId>analysis-model</artifactId>
<version>9.0.0</version>
</dependency>

<dependency>
<groupId>org.eclipse.mylyn.github</groupId>
<artifactId>org.eclipse.egit.github.core</artifactId>
<version>2.1.5</version>
</dependency>
</dependencies>
<dependency>
<groupId>org.eclipse.mylyn.github</groupId>
<artifactId>org.eclipse.egit.github.core</artifactId>
<version>2.1.5</version>
</dependency>
</dependencies>

<properties>
<scmTag>HEAD</scmTag>
<revision>8.1.4</revision>
<changelist>-SNAPSHOT</changelist>
<source.encoding>UTF-8</source.encoding>
<project.build.sourceEncoding>${source.encoding}</project.build.sourceEncoding>
<java.version>1.8</java.version>
<incrementals-plugin.version>1.1</incrementals-plugin.version>
<properties>
<scmTag>HEAD</scmTag>
<revision>8.1.4</revision>
<changelist>-SNAPSHOT</changelist>
<source.encoding>UTF-8</source.encoding>
<project.build.sourceEncoding>${source.encoding}</project.build.sourceEncoding>
<java.version>1.8</java.version>
<incrementals-plugin.version>1.1</incrementals-plugin.version>

<module.name>${project.groupId}.analysis.model</module.name>
<module.name>${project.groupId}.analysis.model</module.name>

<!-- Project Dependencies Configuration -->
<codingstyle.library.version>1.1.0</codingstyle.library.version>
<commons.lang.version>3.10</commons.lang.version>
<commons.io.version>2.7</commons.io.version>
<commons.digester.version>3.2</commons.digester.version>
<commons.text.version>1.8</commons.text.version>
<eclipse-collections.version>9.2.0</eclipse-collections.version>
<spotbugs.parser.library.version>6.0.4</spotbugs.parser.library.version>
<j2html.version>1.4.0</j2html.version>
<slf4j.version>1.7.30</slf4j.version>
<violations-lib.version>1.118</violations-lib.version>
<json.version>20200518</json.version>
<!-- Project Dependencies Configuration -->
<codingstyle.library.version>1.1.0</codingstyle.library.version>
<commons.lang.version>3.10</commons.lang.version>
<commons.io.version>2.7</commons.io.version>
<commons.digester.version>3.2</commons.digester.version>
<commons.text.version>1.8</commons.text.version>
<eclipse-collections.version>9.2.0</eclipse-collections.version>
<spotbugs.parser.library.version>6.0.4</spotbugs.parser.library.version>
<j2html.version>1.4.0</j2html.version>
<slf4j.version>1.7.30</slf4j.version>
<violations-lib.version>1.118</violations-lib.version>
<json.version>20200518</json.version>

<argLine>-Djava.util.logging.config.file=logging.properties</argLine>
</properties>
<argLine>-Djava.util.logging.config.file=logging.properties</argLine>
</properties>

<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>de.tobiasmichael.me.ResultParser.ResultParser</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>edu.hm.hafner.grading.AutoGradingAction</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>

</project>
Loading

0 comments on commit 1a0f7b3

Please sign in to comment.