Skip to content

Commit

Permalink
Add GitHub workflows and update coordinates.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Sep 14, 2020
1 parent 1a0f7b3 commit 95ebb2c
Show file tree
Hide file tree
Showing 10 changed files with 200 additions and 43 deletions.
10 changes: 10 additions & 0 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
addReviewers: false
addAssignees: true

assignees:
- uhafner

skipKeywords:
- wip

numberOfAssignees: 0
43 changes: 43 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
ignore:
- dependency-name: org.eclipse.collections:eclipse-collections
versions:
- ">= 10.a"
- dependency-name: org.eclipse.collections:eclipse-collections-api
versions:
- ">= 10.a"
- dependency-name: org.jenkins-ci.plugins:jackson2-api
versions:
- "> 2.11.1"
- dependency-name: com.fasterxml.jackson.core:jackson-databind
versions:
- "> 2.11.1"
- dependency-name: org.jenkinsci.plugins:pipeline-model-definition
versions:
- "> 1.2"
- dependency-name: org.jenkins-ci.plugins.workflow:workflow-basic-steps
versions:
- "> 2.3"
- dependency-name: org.jenkins-ci.plugins.workflow:workflow-durable-task-step
versions:
- "> 2.9"
- dependency-name: org.ow2.asm:asm
versions:
- "> 5.0.4"
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
versions:
- "3.0.0-M5"
- dependency-name: org.apache.maven.plugins:maven-failsafe-plugin
versions:
- "3.0.0-M5"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
27 changes: 27 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
- name: bug
description: Bugs or performance problems
color: CC0000
- name: dependencies
description: Update of dependencies
color: 0366d6
- name: feature
color: a4c6fb
description: New features
- name: enhancement
description: Enhancement of existing functionality
color: 94a6eb
- name: deprecated
description: Deprecating API
color: f4c21d
- name: removed
description: Removing API
color: e4b21d
- name: tests
description: Enhancement of tests
color: 30cc62
- name: documentation
description: Enhancement of documentation
color: bfafea
- name: internal
description: Internal changes without user or API impact
color: e6e6e6
51 changes: 51 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name-template: 'v$RESOLVED_VERSION 🎁'
tag-template: 'v$RESOLVED_VERSION'

template: |
$CHANGES
# Emoji reference: https://gitmoji.carloscuesta.me/
categories:
- title: 💥 Removed
label: removed
- title: ⚠️ Deprecated
label: deprecated
- title: 🚀 New features
labels:
- feature
- title: ✨ Improvements
labels:
- enhancement
- title: 🐛 Bug Fixes
labels:
- bug
- fix
- bugfix
- regression
- title: 📝 Documentation updates
label: documentation
- title: 📦 Dependency updates
label: dependencies
- title: 🔧 Internal changes
label: internal
- title: 🚦 Tests
labels:
- test
- tests

version-resolver:
major:
labels:
- 'removed'
minor:
labels:
- 'feature'
- 'enhancement'
- 'deprecated'
patch:
labels:
- 'dependencies'
- 'documentation'
- 'tests'
- 'internal'
default: minor
12 changes: 12 additions & 0 deletions .github/workflows/assign-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'Auto Assign PR'

on:
pull_request:

jobs:
add-reviews:
runs-on: ubuntu-latest
steps:
- uses: kentaro-m/auto-assign-action@v1.1.1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
6 changes: 3 additions & 3 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: 'Create Release'

on:
push:
tags:
- 'v*'

name: Create Release

jobs:
build:
name: Create Release
Expand All @@ -22,4 +22,4 @@ jobs:
release_name: Release ${{ github.ref }}
body: Automatic release.
draft: false
prerelease: false
prerelease: false
14 changes: 14 additions & 0 deletions .github/workflows/run-release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Invoke Release Drafter'

on:
push:
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5.11.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Sync labels
on:
push:
branches:
- master
paths:
- .github/labels.yml

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.2
- uses: micnncim/action-label-syncer@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
manifest: .github/labels.yml
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
# Autograding GitHub Action

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

This GitHub action autogrades projects based on a configurable set of metrics and gives feedback on the pull request.
Currently, you can select from the following metrics:
- Test statistics (e.g., number of failed tests)
- Code coverage (e.g., line coverage percentage)
- PIT mutation coverage (e.g., missed mutations' percentage)
- Static analysis (e.g., number of warnings)

### How to use?

This is an example config you could use in your workflow.

```
name: Java CI with Maven
name: 'Autograding Pull Pequest'
on:
pull_request:
Expand All @@ -19,13 +23,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Java CI with Maven
uses: TobiMichael96/github-actions-autograding@0.1.0
- name: Build
run: mvn -V -ntp clean verify -Dmaven.test.failure.ignore=true --file pom.xml
- name: Autograding
uses: uhafner/autograding-github-action@v0.1.0
with:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

#### Configuration

- ``TOKEN: ThisIsSomeToken`` (mandatory) to change the token.
- ``CONFIG: "{\"analysis\": { \"maxScore\": 100, \"errorImpact\": -5}}"`` to change the built in configuration.
- ``TOKEN: ${{ secrets.GITHUB_TOKEN }}``: mandatory GitHub access token.
- ``CONFIG: "{\"analysis\": { \"maxScore\": 100, \"errorImpact\": -5}}"``: optional configuration, see
[manual](https://github.com/uhafner/autograding-model) for details. If not provided a [default configuration](default.conf)
will be used.

37 changes: 5 additions & 32 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,20 @@
<parent>
<groupId>edu.hm.hafner</groupId>
<artifactId>codingstyle-pom</artifactId>
<version>1.1.1</version>
<version>1.5.1</version>
<relativePath/>
</parent>

<groupId>edu.hm.hafner</groupId>
<artifactId>github-actions-autograding</artifactId>
<version>0.1</version>
<artifactId>autograding-github-actions</artifactId>
<version>0.1.0</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>

<dependencies>
Expand All @@ -48,30 +44,8 @@
</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>

<module.name>${project.groupId}.analysis.model</module.name>
<module.name>${project.groupId}.autograding.ghaction</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>

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

<build>
Expand All @@ -92,7 +66,7 @@
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase> <!-- bind to the packaging phase -->
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
Expand All @@ -102,5 +76,4 @@
</plugins>
</build>


</project>

0 comments on commit 95ebb2c

Please sign in to comment.