From 1ad7838116ec34621d39bb1b4a985e7601eab659 Mon Sep 17 00:00:00 2001 From: Clarence Leung Date: Thu, 13 Aug 2020 18:21:08 -0700 Subject: [PATCH] chore(CI): Update Circle CI config to v2.1 (#992) * chore(CI): Update Circle CI config to v2 * chore(CI): Remove initial command * chore(CI): Use same image as babel/babel * chore(CI): Switch to 2.1 * chore(CI): Use similar env as babel * chore(CI): Remove direct PATH * chore(CI): Remove comments * chore(CI): Add submodules back to CI * chore(CI): Better submodule updating * chore(CI): Update test commands * Revert "chore(CI): Update test commands" This reverts commit 0eda27dbcfff3c3bddbae90288d0ca89dcc6fb87. * chore(CI): Fix prettier errors * chore(CI): Fix smoke test * chore(CI): Update jQuery version * chore(CI): Fix jQuery smoke test * chore(CI): Don't rebuild jQuery * chore(CI): Remove unnecessary commands * chore(CI): Remove unused variables --- circle.yml | 62 ++++++++++++++++++++++++++++++--------------- smoke/assets/jquery | 2 +- smoke/run.js | 6 ++--- 3 files changed, 45 insertions(+), 25 deletions(-) diff --git a/circle.yml b/circle.yml index aeb77bc4a..f4b1c2453 100644 --- a/circle.yml +++ b/circle.yml @@ -1,25 +1,45 @@ ---- +version: 2.1 -machine: - node: - version: "node" - environment: - PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin:./node_modules/.bin" +aliases: + - &restore-node-modules-cache + keys: + - v1-yarn-deps-{{ checksum "yarn.lock" }} + - v1-yarn-deps- -checkout: - post: - - git submodule sync - - git submodule update --init --recursive + - &restore-yarn-cache + keys: + - v1-1-yarn-cache-{{ checksum "yarn.lock" }} + - v1-1-yarn-cache- -dependencies: - override: - - yarn - cache_directories: - - ~/.cache/yarn - post: - - yarn build + - &save-node-modules-cache + paths: + - node_modules + key: v1-yarn-deps-{{ checksum "yarn.lock" }} -test: - override: - - ./smoke/circleci.sh: - parallel: true + - &save-yarn-cache + paths: + - ~/.cache/yarn + key: v1-1-yarn-cache-{{ checksum "yarn.lock" }} + +executors: + node-executor: + docker: + - image: circleci/node:latest + working_directory: ~/babel/minify + +jobs: + build: + executor: node-executor + parallelism: 4 + steps: + - checkout + - run: + name: "Pull Submodules" + command: git submodule update --init --recursive + - restore_cache: *restore-yarn-cache + - restore_cache: *restore-node-modules-cache + - run: yarn + - run: yarn build + - save_cache: *save-node-modules-cache + - save_cache: *save-yarn-cache + - run: ./smoke/circleci.sh diff --git a/smoke/assets/jquery b/smoke/assets/jquery index b3defccdc..e1cffdef2 160000 --- a/smoke/assets/jquery +++ b/smoke/assets/jquery @@ -1 +1 @@ -Subproject commit b3defccdc0ca93b49647e79df5e70fb933af679c +Subproject commit e1cffdef277fcf543833a20d28cbadcd000ebece diff --git a/smoke/run.js b/smoke/run.js index 9fcbe59f0..a397ba52a 100644 --- a/smoke/run.js +++ b/smoke/run.js @@ -5,14 +5,14 @@ const TESTS = [ { dir: "html-minifier", files: "src/htmlminifier.js", - build: "grunt dist", - test: "grunt qunit" + build: "npm run dist", + test: "./node_modules/grunt/bin/grunt qunit" }, { dir: "jquery", files: "dist/jquery.js", build: "npm run build", - test: "grunt test" + test: "./node_modules/grunt/bin/grunt test:slow" }, { dir: "lodash",