Skip to content

Commit

Permalink
Setup CircleCI (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
cchantep committed Oct 26, 2021
1 parent ecc939a commit 7812a55
Show file tree
Hide file tree
Showing 3 changed files with 157 additions and 36 deletions.
156 changes: 156 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
version: 2.1

commands:
setup_sbt:
description: Get and install SBT
parameters:
sbt_version:
type: string
default: "1.5.5"
steps:
- restore_cache:
keys:
- &sbt_cache_key sbt-{{ checksum "project/build.properties" }}

- run:
name: Setup SBT
command: |
if [ ! -x ~/sbt/bin/sbt ]; then
cd ~/
curl --silent -L -o sbt.tgz https://github.com/sbt/sbt/releases/download/v<< parameters.sbt_version >>/sbt-<< parameters.sbt_version >>.tgz
tar -xzvf sbt.tgz && rm -f sbt.tgz
fi
- save_cache:
paths:
- ~/sbt
key: *sbt_cache_key

build_n_tests:
description: Build & Run tests
steps:
- restore_cache:
keys:
- &scala_cache_key scala-{{ .Environment.CIRCLE_JOB }}-{{ checksum "version.sbt" }}-{{ checksum "build.sbt" }}

- run:
name: Build & Run tests
command: |
export PATH=$PATH:~/sbt/bin
./.ci_scripts/validate.sh
- save_cache:
paths:
- ~/.ivy2
- ~/.coursier/cache
- ~/.sbt
key: *scala_cache_key

collect_test_reports:
description: Collect test reports
steps:
- run:
name: Collect test report
command: |
mkdir test-reports
find . -path '*/test-reports/*' -name '*.xml' \
-print -exec cp {} test-reports \;
when: always

jobs:
scala211_jdk8:
docker:
- image: circleci/openjdk:8-jdk

working_directory: ~/repo

environment:
SCALA_VERSION: 2.11.12

steps:
- checkout
- setup_sbt
- build_n_tests
- collect_test_reports
- store_test_results:
path: test-reports

scala212_jdk8:
docker:
- image: circleci/openjdk:8-jdk

working_directory: ~/repo

environment:
SCALA_VERSION: 2.12.15

steps:
- checkout
- setup_sbt
- build_n_tests
- collect_test_reports
- store_test_results:
path: test-reports

scala213_jdk8:
docker:
- image: circleci/openjdk:8-jdk

working_directory: ~/repo

environment:
SCALA_VERSION: 2.13.6

steps:
- checkout
- setup_sbt
- build_n_tests
- collect_test_reports
- store_test_results:
path: test-reports

scala212_jdk9:
docker:
- image: circleci/openjdk:9-jdk

working_directory: ~/repo

environment:
SCALA_VERSION: 2.12.15

steps:
- checkout
- setup_sbt
- build_n_tests
- collect_test_reports
- store_test_results:
path: test-reports

scala213_jdk11:
docker:
- image: circleci/openjdk:11-jdk

working_directory: ~/repo

environment:
SCALA_VERSION: 2.13.6

steps:
- checkout
- setup_sbt
- build_n_tests
- collect_test_reports
- store_test_results:
path: test-reports

workflows:
version: 2

main_suite:
jobs:
- scala211_jdk8
- scala212_jdk8
- scala213_jdk8
- scala212_jdk9
- scala213_jdk11
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To run the tests, use:

sbt test

[Travis](https://travis-ci.org/playframework/anorm): ![Travis build status](https://travis-ci.org/playframework/anorm.svg?branch=master)
[CircleCI](https://circleci.com/gh/playframework/anorm): ![CircleCI build status](https://circleci.com/gh/playframework/anorm.png?branch=master)

## Documentation

Expand Down

0 comments on commit 7812a55

Please sign in to comment.