Skip to content

Continuous Integration

Leon Kiefer edited this page Mar 16, 2020 · 2 revisions

Continuous Integration

Preamble

Originally, Travis was used to automate testing after commits. For the season 2019/2020, a GitLab CI Pipeline was used. Currently, a similar GitHub Action Workflow is used.

Current Workflow

The CI workflow in GitHub consists of three different jobs:

  • Test with JDK

  • Run linter

  • Create KDoc

These are described in more detail below. The results are visible on the action page of the project.

Test with JDK

This job builds the project on Java 8 and Java 11 and runs automated tests, e.g. unit tests:

  - ./gradlew check -x detekt -x spotlessCheck
  - ./gradlew codeCoverageReport

Additionally, the code coverage is determinded and the result is printed. This allows for trend analysis of the test results on merge requests.

Run linter

The lint job is used to do some static code analysis.

  - ./gradlew spotlessCheck
  - ./gradlew detekt

Spotless is a code formatting tool that does several reformatting operations on the whole code. Details can be found here: https://github.com/diffplug/spotless/tree/master/plugin-gradle

Detekt is a static code analysis tool to find code smells, code complexity deficits and much more. Details can be found here: https://arturbosch.github.io/detekt/

Create KDoc

This job runs a gradle task for Dokka, the Kotlin homologue of JavaDoc:

  - ./gradlew aggregatedDokka
Its result is a HTML-based extraction of inline documentation.

If the job is executed on a master branch commit, this job moves the document artefacts to the needed doc branch for automatic deployment of GitHub Pages.

Merge Requests

GitHub Actions must succeed to merge a merge request.