From 2c9719331af51ad4ce7c8cd7960d740352857def Mon Sep 17 00:00:00 2001 From: archmoj Date: Tue, 29 Jun 2021 14:02:32 -0400 Subject: [PATCH 1/5] move build environment commands into a script --- .circleci/config.yml | 15 ++------------- .circleci/env_build.sh | 6 ++++++ 2 files changed, 8 insertions(+), 13 deletions(-) create mode 100755 .circleci/env_build.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 3313bbe7803..bcbefc1ebe6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,19 +15,8 @@ jobs: steps: - checkout - run: - name: set heap option before very first node.js call - command: | - export NODE_OPTIONS='--max-old-space-size=4096' - - run: - name: Install dependencies - command: | - npm ci - - run: - name: List dependency versions - command: | - echo "npm: $(npm --version)" - echo "node: $(node --version)" - npm ls || true + name: set up build environment + command: .circleci/env_build.sh - run: name: Pretest command: | diff --git a/.circleci/env_build.sh b/.circleci/env_build.sh new file mode 100755 index 00000000000..3a0ece86750 --- /dev/null +++ b/.circleci/env_build.sh @@ -0,0 +1,6 @@ +#!/bin/sh +export NODE_OPTIONS='--max-old-space-size=4096' && \ +echo "node version: $(node --version)" && \ +echo "npm version: $(npm --version)" && \ +npm ci && \ +npm ls || true From 07f3ee2c3a0e53bf5b74acc6b88ef7729c85cdaf Mon Sep 17 00:00:00 2001 From: archmoj Date: Tue, 29 Jun 2021 14:44:27 -0400 Subject: [PATCH 2/5] publish dist without depending on cibuild step --- .circleci/config.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bcbefc1ebe6..728cc165b4c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -183,8 +183,12 @@ jobs: - image: circleci/node:12.22.1 working_directory: ~/plotly.js steps: - - attach_workspace: - at: ~/ + - checkout + - run: + name: set up build environment + command: .circleci/env_build.sh + - run: + command: rm -rf .git - run: name: Build dist/ command: npm run build @@ -279,9 +283,8 @@ workflows: - source-syntax: requires: - install-and-cibuild - - publish-dist: - requires: - - install-and-cibuild + + - publish-dist - test-dist1: requires: - publish-dist From 98f14f3a688846171ae3b0c4254db3bb8497fbc6 Mon Sep 17 00:00:00 2001 From: archmoj Date: Tue, 29 Jun 2021 16:40:14 -0400 Subject: [PATCH 3/5] do not run very slow and rather optional no-dup-keys test on the CI --- .circleci/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 728cc165b4c..4d9ca519a17 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -244,9 +244,6 @@ jobs: - run: name: Test plotly bundles against es6 command: npm run no-es6-dist - - run: - name: Test plotly bundles againt duplicate keys - command: npm run no-dup-keys workflows: version: 2 From 54d9c28a00f581a8d125d81ad8b1d954f8b17fe9 Mon Sep 17 00:00:00 2001 From: archmoj Date: Tue, 29 Jun 2021 16:50:27 -0400 Subject: [PATCH 4/5] move dist tests into one container --- .circleci/config.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4d9ca519a17..5bcfc93cfb4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -233,14 +233,6 @@ jobs: - run: name: Test certain bundles against function constructors command: npm run no-new-func - - test-dist2: - docker: - - image: circleci/node:12.22.1 - working_directory: ~/plotly.js - steps: - - attach_workspace: - at: ~/ - run: name: Test plotly bundles against es6 command: npm run no-es6-dist @@ -285,6 +277,3 @@ workflows: - test-dist1: requires: - publish-dist - - test-dist2: - requires: - - publish-dist From 41cc6c86936afad35da190d7efb337d5c29a8242 Mon Sep 17 00:00:00 2001 From: archmoj Date: Tue, 29 Jun 2021 16:52:12 -0400 Subject: [PATCH 5/5] run dist tests in the same container where generated - run faster as there is no need to persist_to_workspace & remove git - in case of dist failures catched by tests we could simply rerun from failed and do not have to rerun from start --- .circleci/config.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5bcfc93cfb4..b3c1bff8b87 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -187,8 +187,6 @@ jobs: - run: name: set up build environment command: .circleci/env_build.sh - - run: - command: rm -rf .git - run: name: Build dist/ command: npm run build @@ -212,18 +210,6 @@ jobs: echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.js echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plotly.min.js echo https://$CIRCLE_BUILD_NUM-$PROJECT_NUM-gh.circle-artifacts.com/0/dist/plot-schema.json - - persist_to_workspace: - root: ~/ - paths: - - plotly.js - - test-dist1: - docker: - - image: circleci/node:12.22.1 - working_directory: ~/plotly.js - steps: - - attach_workspace: - at: ~/ - run: name: Test plotly.min.js import using requirejs command: npm run test-requirejs @@ -274,6 +260,3 @@ workflows: - install-and-cibuild - publish-dist - - test-dist1: - requires: - - publish-dist