Skip to content

Commit

Permalink
Test new projects and test against JDK 10 and 11 (#693)
Browse files Browse the repository at this point in the history
* Add tests for new figwheel projects and simplify test runner

* Abstract out build config

* Build against JDK 8, 10, 11

* Enable tests for all projects

* Add back install

* Use Makefiles where they exist

* Remove make, as it is not on circle images

* Reorder install order
  • Loading branch information
danielcompton authored and Bruce Hauman committed Jun 15, 2018
1 parent f0c9bee commit 4828ee6
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 33 deletions.
71 changes: 41 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
defaults: &defaults
working_directory: ~/lein-figwheel
environment:
LEIN_ROOT: nbd
JVM_OPTS: -Xmx3200m
steps:
- checkout
- run: scripts/install-lein
- run: scripts/dependency-checksum
- restore_cache:
key: figwheel-v1-{{ checksum "checksum.tmp" }}
- run:
name: Install all JARs
command: scripts/install
- run:
name: Test all projects
command: scripts/test-all
- save_cache:
paths:
- ~/.m2
- ~/.lein/self-installs
key: figwheel-v1-{{ checksum "checksum.tmp" }}

version: 2
jobs:
build:
working_directory: ~/lein-figwheel
build-jdk-8:
<<: *defaults
docker:
- image: circleci/clojure:lein-2.7.1
environment:
LEIN_ROOT: nbd
JVM_OPTS: -Xmx3200m
steps:
- checkout
# See https://discuss.circleci.com/t/cant-checksum-multiple-files-with-slashes-in-the-file-path/20667 for why we do this:
- run: shasum sidecar/project.clj plugin/project.clj support/project.clj > checksum.tmp
- restore_cache:
key: figwheel-{{ checksum "checksum.tmp" }}
- run: scripts/install
- save_cache:
paths:
- ~/.m2
key: figwheel-{{ checksum "checksum.tmp" }}
- run:
name: Test plugin
command: lein test
working_directory: plugin
- run:
name: Test sidecar
command: lein test
working_directory: sidecar
- run:
name: Test support
command: lein test
working_directory: support

- image: circleci/openjdk:8-node
build-jdk-10:
<<: *defaults
docker:
- image: circleci/openjdk:10-node
build-jdk-11:
<<: *defaults
docker:
- image: circleci/openjdk:11-ea-node-browsers
workflows:
version: 2
build-all:
jobs:
- build-jdk-8
- build-jdk-10
- build-jdk-11
8 changes: 8 additions & 0 deletions scripts/dependency-checksum
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -ex

# See https://discuss.circleci.com/t/cant-checksum-multiple-files-with-slashes-in-the-file-path/20667 for why we do this:
# Calculates checksums for all Figwheel project dependencies.

shasum sidecar/project.clj plugin/project.clj support/project.clj figwheel-core/deps.edn figwheel-main/deps.edn figwheel-repl/deps.edn /usr/local/bin/lein > checksum.tmp
10 changes: 7 additions & 3 deletions scripts/install
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/bash

pushd support ; lein install ; popd
pushd sidecar ; lein install ; popd
pushd plugin ; lein install ; popd
set -ex

# We install all JARs so that cross project dependencies work correctly.
for project in "figwheel-repl" "figwheel-core" "figwheel-main" "plugin" "sidecar" "support"; do
pushd ${project}
lein install
popd
done
8 changes: 8 additions & 0 deletions scripts/install-lein
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -ex

# Used for CircleCI so that we can have a build matrix of multiple JDK's to test against.
# The Clojure images they provide only have a single JDK 8 available.
sudo wget -O /usr/local/bin/lein https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
sudo chmod a+x /usr/local/bin/lein
10 changes: 10 additions & 0 deletions scripts/test-all
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -ex

# TODO: add "figwheel-core" "figwheel-main"
for project in "figwheel-repl" "plugin" "sidecar" "support"; do
pushd ${project}
lein test
popd
done

0 comments on commit 4828ee6

Please sign in to comment.