Commit 3d766b34 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis 🚴🏽

Merge branch 'ci-scala-example' into 'master'

Ci scala example

## What does this MR do?

Add a scala CI example.

## Why was this MR needed?


See merge request !4774
parents 00906b5b 56777e89
Pipeline #3544769 passed with stages
in 1064 minutes and 39 seconds
......@@ -4,7 +4,8 @@
- [Test and deploy a Ruby application to Heroku](
- [Test and deploy a Python application to Heroku](
- [Test a Clojure application](
- [Using `dpl` as deployment tool](../deployment/
- [Test a Scala application](
- [Using `dpl` as deployment tool](deployment/
- Help your favorite programming language and GitLab by sending a merge request
with a guide for that language.
## Test a Scala application
This example demonstrates the integration of Gitlab CI with Scala
applications using SBT. Checkout the example
[project]( and
[build status](
### Add `.gitlab-ci.yml` file to project
The following `.gitlab-ci.yml` should be added in the root of your
repository to trigger CI:
``` yaml
image: java:8
- apt-get update -y
- apt-get install apt-transport-https -y
# Install SBT
- echo "deb /" | tee -a /etc/apt/sources.list.d/sbt.list
- apt-key adv --keyserver hkp:// --recv 642AC823
- apt-get update -y
- apt-get install sbt -y
- sbt sbt-version
- sbt clean coverage test coverageReport
The `before_script` installs [SBT]( and
displays the version that is being used. The `test` stage executes SBT
to compile and test the project.
[scoverage]( is used as an SBT
plugin to measure test coverage.
You can use other versions of Scala and SBT by defining them in
### Display test coverage in build
Add the `Coverage was \[\d+.\d+\%\]` regular expression in the
**Settings > Edit Project > Test coverage parsing** project setting to
retrieve the test coverage rate from the build trace and have it
displayed with your builds.
**Builds** must be enabled for this option to appear.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment