diff --git a/.circleci/config.yml b/.circleci/config.yml index 1154d4230..d8999a521 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,46 +12,62 @@ jobs: - checkout - restore_cache: keys: - - v1-npm-{{ .Branch }}-{{ checksum "package.json" }} - - v1-npm-master-{{ checksum "package.json" }} + - v3-npm-{{ .Branch }}-{{ checksum "package.json" }} + - v3-npm-master-{{ checksum "package.json" }} - run: name: Install dependencies command: | npm config set strict-ssl false - # Avoid downloading chromium unnecessarily - npm config set ignore-scripts true - npm install - npm config set ignore-scripts false + # puppeteer install script throws syntax errors for Node v4 + # https://github.com/GoogleChrome/puppeteer/blob/f19e2ade0d4859435422131905e932abe3db199c/install.js#L66 + if node --version | grep -q '^v4'; then + npm config set ignore-scripts true + npm install + npm config set ignore-scripts false + else + npm install + fi + + # install latest chrome unstable version + if node --version | grep -q '^v6'; then + wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - + echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list + apt-get update + apt-get install -y --no-install-recommends google-chrome-unstable + fi - run: name: Pre-Test # ESLint only supports Node >=4 command: | - NODE_VERSION=$(node --version) - if [[ ${NODE_VERSION:0:3} == "v6." ]]; then + if node --version | grep -q '^v6'; then npm run lint; + npm run test-headless -- --chrome $(which google-chrome-unstable) --allow-chrome-as-root; + npm run test-webworker -- --chrome $(which google-chrome-unstable) --allow-chrome-as-root; fi - run: name: Test command: npm run test-node - save_cache: - key: v1-npm-{{ .Branch }}-{{ checksum "package.json" }} + key: v3-npm-{{ .Branch }}-{{ checksum "package.json" }} paths: - node_modules node-4: <<: *common-build docker: - - image: node:4 + - image: node:4-alpine node-6: <<: *common-build docker: - - image: node:6-alpine + - image: node:6 node-8: <<: *common-build docker: - - image: node:8 + - image: node:8-alpine + environment: + PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true workflows: version: 2 diff --git a/package.json b/package.json index e2999fe9f..55d338a5c 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "lint-staged": "^4.0.0", "markdownlint-cli": "^0.4.0", "mocha": "^4.0.0", - "mochify": "^5.0.0", + "mochify": "^5.1.0", "mochify-istanbul": "^2.4.1", "native-promise-only": "^0.8.1", "npm-run-all": "^4.0.2",