From 7eab3e79266d5fdd7cf52a598b95aba0e18851da Mon Sep 17 00:00:00 2001 From: Andrea Richiardi Date: Thu, 28 Feb 2019 18:03:59 -0800 Subject: [PATCH 1/4] Use CircleCI for Continuous Integration This patch removes the Travis yaml and adds the CircleCI one instead. --- .circleci/config.yml | 159 +++++++++++++++++++++++++++++++++++++++++++ .travis.yml | 58 ---------------- 2 files changed, 159 insertions(+), 58 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 .travis.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..c7a79b93a --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,159 @@ +version: 2.1 + +defaults: &defaults + working_directory: ~/repo + environment: + LEIN_ROOT: "true" + JVM_OPTS: -Xmx3200m + + +executors: + openjdk8: + docker: + - image: circleci/clojure:openjdk-8-lein-2.9.0 + <<: *defaults + openjdk11: + docker: + - image: circleci/clojure:openjdk-11-lein-2.9.0 + <<: *defaults + +jobs: + checkout_code: + executor: openjdk11 + steps: + - checkout + - restore_cache: + keys: + - v2-dependencies-{{ checksum "project.clj" }} + - v2-dependencies- + - run: + name: Downloading deps + command: | + lein deps + - save_cache: + paths: + - ~/.m2 + key: v2-dependencies-{{ checksum "project.clj" }} + - persist_to_workspace: + root: /home/circleci + paths: + - .m2 + - repo + + lint_code: + executor: openjdk11 + steps: + - attach_workspace: + at: /home/circleci + - run: + name: Install make + command: | + sudo apt-get install make + - run: + name: Running Eastwood + command: | + make eastwood + - run: + name: Running cljfmt + command: | + make cljfmt + + test_code: + description: Run tests + 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: + CLOJURE_VERSION: << parameters.clojure_version >> + steps: + - attach_workspace: + at: /home/circleci + - run: + name: Install make + command: | + sudo apt-get install make + - run: + name: Running tests + command: make test + + codecov: + executor: openjdk11 + environment: + CLOJURE_VERSION: "1.9" + steps: + - attach_workspace: + at: /home/circleci + - run: + name: Install make + command: | + sudo apt-get install make + - run: + name: Running cloverage + command: | + make cloverage + +workflows: + version: 2.1 + build_and_test: + jobs: + - checkout_code + - lint_code: + name: Code Linting + requires: + - checkout_code + - test_code: + name: java8, clj1.8 tests + clojure_version: "1.8" + jdk_version: openjdk8 + requires: + - checkout_code + - test_code: + name: java8, clj1.9 tests + clojure_version: "1.9" + jdk_version: openjdk8 + requires: + - checkout_code + - test_code: + name: java8, clj1.10 tests + clojure_version: "1.10" + jdk_version: openjdk8 + requires: + - checkout_code + - test_code: + name: java8, clj master tests + clojure_version: "master" + jdk_version: openjdk8 + requires: + - checkout_code + - test_code: + name: java11, clj1.8 tests + clojure_version: "1.8" + jdk_version: openjdk11 + requires: + - checkout_code + - test_code: + name: java11, clj1.9 tests + clojure_version: "1.9" + jdk_version: openjdk11 + requires: + - checkout_code + - test_code: + name: java11, clj1.10 tests + clojure_version: "1.10" + jdk_version: openjdk11 + requires: + - checkout_code + - test_code: + name: java11, clj master tests + clojure_version: "master" + jdk_version: openjdk11 + requires: + - checkout_code + - codecov: + requires: + - checkout_code diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ff56e3fbe..000000000 --- a/.travis.yml +++ /dev/null @@ -1,58 +0,0 @@ -dist: xenial -language: clojure -lein: 2.8.3 -cache: - directories: - - $HOME/.m2 -script: - - make $TARGET -env: - matrix: - - CLOJURE_VERSION=1.8 TARGET='test smoketest' - - CLOJURE_VERSION=1.9 TARGET='test smoketest' - - CLOJURE_VERSION=1.10 TARGET='test smoketest' - - CLOJURE_VERSION=master TARGET='test smoketest' - global: - - secure: "bCp4gU7XgeqLnqKwEpJarnKPbGljHyLE2rZnub4mEHD8kcvh6LoEkG/2QCtnSETj8zrQJwyMuEDGUwPgjmzQ/aEn6UiIYmv7ka6QnLBxOxhqQTbDtG7HssfkeT5b67LgOyQX7ejK88vnmH+OeWXM7kOOvUwVy5BVgsYyr2f1cGU=" - - secure: "D2Ie7dUZ9nQOIWtkRl2XWZeijSL8expUXP3GziSqQV1scJzwexxnUsRvWOkc2YU8+6IIGz9tcyt9RrEFUVF31VZgRSHh8P5rGGCzI2l99djKhYFfSErElwgoAJZFtOzougZK66/Gtb5uDo5L/wlKHkl4st3miqm+mEvfJITDjRQ=" -jdk: - - openjdk8 - - openjdk11 - - openjdk-ea -stages: - - name: check - - name: test - - name: deploy - # Deploy only from the home repo where the credentials can be - # properly decrypted. Never deploy from a pull request job. - # In addition, ensure we're on the master branch (snapshots) - # or a branch with semver naming (releases). - if: repo = clojure-emacs/cider-nrepl - AND type != pull_request - AND ( branch = master OR branch =~ ^v[0-9]+\.[0-9]+\.[0-9]+.*$ ) - -jobs: - include: - - stage: check - env: CLOJURE_VERSION=1.10 TARGET=eastwood - jdk: openjdk11 - - - stage: check - env: CLOJURE_VERSION=1.10 TARGET=cljfmt - jdk: openjdk11 - - - stage: test - env: CLOJURE_VERSION=1.10 TARGET=cloverage - jdk: openjdk11 - after_success: bash <(curl -s https://codecov.io/bash) -f target/coverage/codecov.json - - - stage: deploy - env: TARGET=deploy - jdk: openjdk11 - -matrix: - fast_finish: true - allow_failures: - - jdk: openjdk-ea - - env: CLOJURE_VERSION=master TARGET='test smoketest' - - env: CLOJURE_VERSION=1.10 TARGET=cloverage From 21f9e5ef32594bd384e50a7bbd685a6c5799a4f3 Mon Sep 17 00:00:00 2001 From: Shen Tian Date: Thu, 28 Mar 2019 13:11:21 +0200 Subject: [PATCH 2/4] Restoring travis. So we can rebase more easily This reverts commit 7eab3e79266d5fdd7cf52a598b95aba0e18851da. --- .travis.yml | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..ff56e3fbe --- /dev/null +++ b/.travis.yml @@ -0,0 +1,58 @@ +dist: xenial +language: clojure +lein: 2.8.3 +cache: + directories: + - $HOME/.m2 +script: + - make $TARGET +env: + matrix: + - CLOJURE_VERSION=1.8 TARGET='test smoketest' + - CLOJURE_VERSION=1.9 TARGET='test smoketest' + - CLOJURE_VERSION=1.10 TARGET='test smoketest' + - CLOJURE_VERSION=master TARGET='test smoketest' + global: + - secure: "bCp4gU7XgeqLnqKwEpJarnKPbGljHyLE2rZnub4mEHD8kcvh6LoEkG/2QCtnSETj8zrQJwyMuEDGUwPgjmzQ/aEn6UiIYmv7ka6QnLBxOxhqQTbDtG7HssfkeT5b67LgOyQX7ejK88vnmH+OeWXM7kOOvUwVy5BVgsYyr2f1cGU=" + - secure: "D2Ie7dUZ9nQOIWtkRl2XWZeijSL8expUXP3GziSqQV1scJzwexxnUsRvWOkc2YU8+6IIGz9tcyt9RrEFUVF31VZgRSHh8P5rGGCzI2l99djKhYFfSErElwgoAJZFtOzougZK66/Gtb5uDo5L/wlKHkl4st3miqm+mEvfJITDjRQ=" +jdk: + - openjdk8 + - openjdk11 + - openjdk-ea +stages: + - name: check + - name: test + - name: deploy + # Deploy only from the home repo where the credentials can be + # properly decrypted. Never deploy from a pull request job. + # In addition, ensure we're on the master branch (snapshots) + # or a branch with semver naming (releases). + if: repo = clojure-emacs/cider-nrepl + AND type != pull_request + AND ( branch = master OR branch =~ ^v[0-9]+\.[0-9]+\.[0-9]+.*$ ) + +jobs: + include: + - stage: check + env: CLOJURE_VERSION=1.10 TARGET=eastwood + jdk: openjdk11 + + - stage: check + env: CLOJURE_VERSION=1.10 TARGET=cljfmt + jdk: openjdk11 + + - stage: test + env: CLOJURE_VERSION=1.10 TARGET=cloverage + jdk: openjdk11 + after_success: bash <(curl -s https://codecov.io/bash) -f target/coverage/codecov.json + + - stage: deploy + env: TARGET=deploy + jdk: openjdk11 + +matrix: + fast_finish: true + allow_failures: + - jdk: openjdk-ea + - env: CLOJURE_VERSION=master TARGET='test smoketest' + - env: CLOJURE_VERSION=1.10 TARGET=cloverage From ccdc1a0d5c26095441d07219f203ec38d67a9b30 Mon Sep 17 00:00:00 2001 From: Shen Tian Date: Thu, 28 Mar 2019 13:17:13 +0200 Subject: [PATCH 3/4] Using refactor-nrepl config as a starting point --- .circleci/config.yml | 210 ++++++++++++++++++++++++------------------- 1 file changed, 117 insertions(+), 93 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c7a79b93a..dfdfb1824 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,65 +1,105 @@ 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" - JVM_OPTS: -Xmx3200m + 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.0 + - image: circleci/clojure:openjdk-8-lein-2.9.1-node <<: *defaults openjdk11: docker: - - image: circleci/clojure:openjdk-11-lein-2.9.0 + - image: circleci/clojure:openjdk-11-lein-2.9.1-node <<: *defaults -jobs: - checkout_code: - executor: openjdk11 +# 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: - - checkout - - restore_cache: - keys: - - v2-dependencies-{{ checksum "project.clj" }} - - v2-dependencies- - run: - name: Downloading deps + name: Install make command: | - lein deps + 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 - key: v2-dependencies-{{ checksum "project.clj" }} - - persist_to_workspace: - root: /home/circleci - 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: - lint_code: + 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: - - attach_workspace: - at: /home/circleci - - run: - name: Install make - command: | - sudo apt-get install make - - run: - name: Running Eastwood - command: | - make eastwood - - run: - name: Running cljfmt - command: | - make cljfmt + - checkout + - with_cache: + cache_version: "1.10" + steps: << parameters.steps >> + test_code: - description: Run tests + description: | + Run tests against given version of JDK and Clojure parameters: jdk_version: description: Version of JDK to test against @@ -69,91 +109,75 @@ jobs: type: string executor: << parameters.jdk_version >> environment: - CLOJURE_VERSION: << parameters.clojure_version >> + VERSION: << parameters.clojure_version >> steps: - - attach_workspace: - at: /home/circleci - - run: - name: Install make - command: | - sudo apt-get install make - - run: - name: Running tests - command: make test + - checkout + - with_cache: + cache_version: << parameters.clojure_version >> + steps: + - run: + name: Running tests with inlined deps + command: make test smoketest + +###################################################################### +# +# End general purpose configs +# +###################################################################### - codecov: - executor: openjdk11 - environment: - CLOJURE_VERSION: "1.9" - steps: - - attach_workspace: - at: /home/circleci - - run: - name: Install make - command: | - sudo apt-get install make - - run: - name: Running cloverage - command: | - make cloverage + +# 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 - build_and_test: + ci-test-matrix: jobs: - - checkout_code - - lint_code: - name: Code Linting - requires: - - checkout_code - test_code: - name: java8, clj1.8 tests + name: Java 8, Clojure 1.8 clojure_version: "1.8" jdk_version: openjdk8 - requires: - - checkout_code - test_code: - name: java8, clj1.9 tests + name: Java 8, Clojure 1.9 clojure_version: "1.9" jdk_version: openjdk8 - requires: - - checkout_code - test_code: - name: java8, clj1.10 tests + name: Java 8, Clojure 1.10 clojure_version: "1.10" jdk_version: openjdk8 - requires: - - checkout_code - test_code: - name: java8, clj master tests + name: Java 8, Clojure master clojure_version: "master" jdk_version: openjdk8 - requires: - - checkout_code - test_code: - name: java11, clj1.8 tests + name: Java 11, Clojure 1.8 clojure_version: "1.8" jdk_version: openjdk11 - requires: - - checkout_code - test_code: - name: java11, clj1.9 tests + name: Java 11, Clojure 1.9 clojure_version: "1.9" jdk_version: openjdk11 - requires: - - checkout_code - test_code: - name: java11, clj1.10 tests + name: Java 11, Clojure 1.10 clojure_version: "1.10" jdk_version: openjdk11 - requires: - - checkout_code - test_code: - name: java11, clj master tests + name: Java 11, Clojure master clojure_version: "master" jdk_version: openjdk11 - requires: - - checkout_code - - codecov: - requires: - - checkout_code + - util_job: + name: Code Linting + steps: + - run: + name: Running Eastwood + command: | + make eastwood + - run: + name: Running cljfmt + command: | + make cljfmt From 5d896c1237586813c2fd710ee502761139f88f38 Mon Sep 17 00:00:00 2001 From: Shen Tian Date: Thu, 28 Mar 2019 13:26:03 +0200 Subject: [PATCH 4/4] Removing travis config + references --- .travis.yml | 58 ------------------- README.md | 2 +- .../middleware/debug_integration_test.clj | 2 +- 3 files changed, 2 insertions(+), 60 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b245d3784..000000000 --- a/.travis.yml +++ /dev/null @@ -1,58 +0,0 @@ -dist: xenial -language: clojure -lein: 2.9.1 -cache: - directories: - - $HOME/.m2 -script: - - make $TARGET -env: - matrix: - - CLOJURE_VERSION=1.8 TARGET='test smoketest' - - CLOJURE_VERSION=1.9 TARGET='test smoketest' - - CLOJURE_VERSION=1.10 TARGET='test smoketest' - - CLOJURE_VERSION=master TARGET='test smoketest' - global: - - secure: "bCp4gU7XgeqLnqKwEpJarnKPbGljHyLE2rZnub4mEHD8kcvh6LoEkG/2QCtnSETj8zrQJwyMuEDGUwPgjmzQ/aEn6UiIYmv7ka6QnLBxOxhqQTbDtG7HssfkeT5b67LgOyQX7ejK88vnmH+OeWXM7kOOvUwVy5BVgsYyr2f1cGU=" - - secure: "D2Ie7dUZ9nQOIWtkRl2XWZeijSL8expUXP3GziSqQV1scJzwexxnUsRvWOkc2YU8+6IIGz9tcyt9RrEFUVF31VZgRSHh8P5rGGCzI2l99djKhYFfSErElwgoAJZFtOzougZK66/Gtb5uDo5L/wlKHkl4st3miqm+mEvfJITDjRQ=" -jdk: - - openjdk8 - - openjdk11 - - openjdk-ea -stages: - - name: check - - name: test - - name: deploy - # Deploy only from the home repo where the credentials can be - # properly decrypted. Never deploy from a pull request job. - # In addition, ensure we're on the master branch (snapshots) - # or a branch with semver naming (releases). - if: repo = clojure-emacs/cider-nrepl - AND type != pull_request - AND ( branch = master OR branch =~ ^v[0-9]+\.[0-9]+\.[0-9]+.*$ ) - -jobs: - include: - - stage: check - env: CLOJURE_VERSION=1.10 TARGET=eastwood - jdk: openjdk11 - - - stage: check - env: CLOJURE_VERSION=1.10 TARGET=cljfmt - jdk: openjdk11 - - - stage: test - env: CLOJURE_VERSION=1.10 TARGET=cloverage - jdk: openjdk11 - after_success: bash <(curl -s https://codecov.io/bash) -f target/coverage/codecov.json - - - stage: deploy - env: TARGET=deploy - jdk: openjdk11 - -matrix: - fast_finish: true - allow_failures: - - jdk: openjdk-ea - - env: CLOJURE_VERSION=master TARGET='test smoketest' - - env: CLOJURE_VERSION=1.10 TARGET=cloverage diff --git a/README.md b/README.md index be4e9cb65..de695db95 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/test/clj/cider/nrepl/middleware/debug_integration_test.clj b/test/clj/cider/nrepl/middleware/debug_integration_test.clj index 1497e0486..ba390a8a1 100644 --- a/test/clj/cider/nrepl/middleware/debug_integration_test.clj +++ b/test/clj/cider/nrepl/middleware/debug_integration_test.clj @@ -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"})