Continuous Integration and Continuous Deployment with Scala

Circle supports building Scala applications with sbt. Before each build we look at your repository and infer commands to run, so most setups should work automatically.

If you’d like something specific that’s not being inferred, you can say so with a configuration file checked into the root of your repository.


We pre-install several versions of Scala on Ubuntu 12.04 build image.

You can specify the JVM version you want to run Scala on top of by following the steps described in the Java doc.

Using a custom version of sbt

The latest version of sbt currently supported by CircleCI is 0.13.9. If you would like to use a different version of sbt for your builds, we suggest upgrading it manually. Here is an example of installing the version 0.13.12 of sbt by downloading a binary from Bintray:

    - wget -q
    - sudo dpkg -i sbt-0.13.12.deb
    - "~/.ivy2"
    - "~/.sbt"

Another option would be to use the jars provided by Typesafe:

    SBT_VERSION: 0.13.12
    SBT_OPTS: "-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled
    - "~/.sbt"
    - wget --output-document=$HOME/bin/sbt-launch.jar"$SBT_VERSION"/sbt-launch.jar
    - echo "java $SBT_OPTS -jar \`dirname \$0\`/sbt-launch.jar \"\$@\""
      > $HOME/bin/sbt
    - chmod u+x $HOME/bin/sbt
    - which sbt
    - sbt sbt-version

Dependencies & Tests

Circle can cache directories in between builds to avoid unnecessary work.

By default, when we detect a Scala project, we will run sbt test:compile to resolve the dependencies and sbt test:test to run the tests. You can customize the commands that are run by setting the override, pre and / or post in the dependencies and test sections.