From 52b44bb0cb1db8c392c5d56f1004893593d5037b Mon Sep 17 00:00:00 2001 From: Frank Harrison Date: Sat, 2 Nov 2019 07:51:20 +0000 Subject: [PATCH 1/3] Adds yarn-based (instead of npm) circleci CI/CD config We use circle because it is very simple to setup and took less than 20 mins to implement and test. Here we use a rolling docker image for node.js, so we get constantly test against latest. At some point it may be prudent to schedule a build so we can disambiguate between code-fails and node upgrade fails. --- .circleci/config.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..4c1f33d --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,37 @@ +# Javascript Node CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-javascript/ for more details +# +version: 2 +jobs: + build: + docker: + # specify the version you desire here + - image: circleci/node + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + # - image: circleci/mongo:3.4.4 + + working_directory: ~/repo + + steps: + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: yarn install + + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package.json" }} + + # run tests! + - run: yarn test From 51175d203fa012329922f5df2e79d91f8d611863 Mon Sep 17 00:00:00 2001 From: Frank Harrison Date: Sat, 2 Nov 2019 08:10:45 +0000 Subject: [PATCH 2/3] Explicitly install node-red@0.20.0 inside the CI/CD builds Although this step is clearly listed in the docs, this caught me out when running through the examples because, at the time of writing, non-0.18.0/0.20.0 are the only versions that appear to work with this framework, not latest. Whilst it is clearly expressed as an npm peerDependency and using the most recent version of node-red does print errors about this, new people to the framework may be put off by this - as it *appear* that it doesn't work out-of-the-box. Part of the reason for this PR is to demonstrate how to use these tools. --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4c1f33d..daab8ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -26,7 +26,11 @@ jobs: # fallback to using the latest cache if no exact match is found - v1-dependencies- + # Install latest deps and the version of node-red that is support by the + # node-red-node-test-help frameworker. We do this here rather than in the + # package.json. - run: yarn install + - run: yarn add node-red@0.20.0 - save_cache: paths: From 41264bae8e4c0df49011bbc896dea67cbc838351 Mon Sep 17 00:00:00 2001 From: Frank Harrison Date: Sat, 2 Nov 2019 08:13:07 +0000 Subject: [PATCH 3/3] Adds a run-step for the examples to the CI --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index daab8ee..981480f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,3 +39,6 @@ jobs: # run tests! - run: yarn test + + # run examples! + - run: yarn run examples