Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup CircleCI #400

Merged
merged 1 commit into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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