Skip to content

Commit

Permalink
Use CircleCI for Continuous Integration (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
arichiardi authored and bbatsov committed Mar 28, 2019
1 parent 2249b55 commit 1016f61
Show file tree
Hide file tree
Showing 4 changed files with 185 additions and 60 deletions.
183 changes: 183 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
version: 2.1

######################################################################
#
# Start of general purpose config. These can plausibly go into orbs
#
######################################################################

# Default settings for executors

defaults: &defaults
working_directory: ~/repo
environment:
LEIN_ROOT: "true" # we intended to run lein as root
JVM_OPTS: -Xmx3200m # limit the maximum heap size to prevent out of memory errors

# Runners for OpenJDK 8 and 11

executors:
openjdk8:
docker:
- image: circleci/clojure:openjdk-8-lein-2.9.1-node
<<: *defaults
openjdk11:
docker:
- image: circleci/clojure:openjdk-11-lein-2.9.1-node
<<: *defaults

# Runs a given set of steps, with some standard pre- and post-
# steps, including restoring of cache, saving of cache.
#
# we also install `make` here.
#
# Adapted from https://github.com/lambdaisland/meta/blob/master/circleci/clojure_orb.yml

commands:
with_cache:
description: |
Run a set of steps with Maven dependencies and Clojure classpath cache
files cached.
This command restores ~/.m2 and .cpcache if they were previously cached,
then runs the provided steps, and finally saves the cache.
The cache-key is generated based on the contents of `deps.edn` present in
the `working_directory`.
parameters:
steps:
type: steps
files:
description: Files to consider when creating the cache key
type: string
default: "deps.edn project.clj build.boot"
cache_version:
type: string
description: "Change this value to force a cache update"
default: "1"
steps:
- run:
name: Install make
command: |
sudo apt-get install make
- run:
name: Generate Cache Checksum
command: |
for file in << parameters.files >>
do
find . -name $file -exec cat {} +
done | shasum | awk '{print $1}' > /tmp/clojure_cache_seed
- restore_cache:
key: clojure-<< parameters.cache_version >>-{{ checksum "/tmp/clojure_cache_seed" }}
- steps: << parameters.steps >>
- save_cache:
paths:
- ~/.m2
- .cpcache
- repo
key: clojure-<< parameters.cache_version >>-{{ checksum "/tmp/clojure_cache_seed" }}

# The jobs are relatively simple. One runs utility commands against
# latest stable JDK + Clojure, the other against specified versions

jobs:

util_job:
description: |
Running utility commands/checks (linter etc.)
Always uses Java11 and Clojure 1.10
parameters:
steps:
type: steps
executor: openjdk11
environment:
VERSION: "1.10"
steps:
- checkout
- with_cache:
cache_version: "1.10"
steps: << parameters.steps >>


test_code:
description: |
Run tests against given version of JDK and Clojure
parameters:
jdk_version:
description: Version of JDK to test against
type: string
clojure_version:
description: Version of Clojure to test against
type: string
executor: << parameters.jdk_version >>
environment:
VERSION: << parameters.clojure_version >>
steps:
- checkout
- with_cache:
cache_version: << parameters.clojure_version >>
steps:
- run:
name: Running tests with inlined deps
command: make test smoketest

######################################################################
#
# End general purpose configs
#
######################################################################


# The ci-test-matrix does the following:
#
# - run tests against the target matrix
# - Java 8 and 11
# - Clojure 1.8, 1.9, 1.10, master
# - linter, eastwood and cljfmt
# - runs code coverage report

workflows:
version: 2.1
ci-test-matrix:
jobs:
- test_code:
name: Java 8, Clojure 1.8
clojure_version: "1.8"
jdk_version: openjdk8
- test_code:
name: Java 8, Clojure 1.9
clojure_version: "1.9"
jdk_version: openjdk8
- test_code:
name: Java 8, Clojure 1.10
clojure_version: "1.10"
jdk_version: openjdk8
- test_code:
name: Java 8, Clojure master
clojure_version: "master"
jdk_version: openjdk8
- test_code:
name: Java 11, Clojure 1.8
clojure_version: "1.8"
jdk_version: openjdk11
- test_code:
name: Java 11, Clojure 1.9
clojure_version: "1.9"
jdk_version: openjdk11
- test_code:
name: Java 11, Clojure 1.10
clojure_version: "1.10"
jdk_version: openjdk11
- test_code:
name: Java 11, Clojure master
clojure_version: "master"
jdk_version: openjdk11
- util_job:
name: Code Linting
steps:
- run:
name: Running Eastwood
command: |
make eastwood
- run:
name: Running cljfmt
command: |
make cljfmt
58 changes: 0 additions & 58 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
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/clojure-emacs/cider-nrepl.png?branch=master)](https://travis-ci.org/clojure-emacs/cider-nrepl)
[![CircleCI](https://circleci.com/gh/clojure-emacs/cider-nrepl/tree/master.svg?style=svg)](https://circleci.com/gh/clojure-emacs/cider-nrepl/tree/master)
[![Dependencies Status](https://versions.deps.co/clojure-emacs/cider-nrepl/status.svg)](https://versions.deps.co/clojure-emacs/cider-nrepl)
[![Coverage](https://codecov.io/gh/clojure-emacs/cider-nrepl/branch/master/graph/badge.svg)](https://codecov.io/gh/clojure-emacs/cider-nrepl/)
[![cljdoc badge](https://cljdoc.org/badge/cider/cider-nrepl)](https://cljdoc.org/d/cider/cider-nrepl/CURRENT)
Expand Down
2 changes: 1 addition & 1 deletion test/clj/cider/nrepl/middleware/debug_integration_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@
;; and instrument the source, which is in a jar file. Note that this function
;; is used because it is not marked as a :source-dep, so we can rely on the
;; namespace remaining unmunged, which is important when these tests run on
;; travis CI.
;; CI.
(--> :eval "(ns user.test.step-in
(:require [nrepl.server :as server]))")
(<-- {:ns "user.test.step-in"})
Expand Down

0 comments on commit 1016f61

Please sign in to comment.