From a4a3ae40294e0bcb1cd2016a95735d110241d136 Mon Sep 17 00:00:00 2001 From: Michael Mok Date: Mon, 18 May 2020 03:57:42 +0800 Subject: [PATCH] ci: use exact node versions and setup headless chrome deps --- .circleci/config.yml | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 79733794..c3fb1f15 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,6 +3,20 @@ version: 2.1 orbs: node: circleci/node@2.1.1 +commands: + setup-headless-chrome: + steps: + - run: + name: Install dependencies for Headless Chrome + command: | + sudo apt-get update + sudo apt-get install -yq \ + gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \ + libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \ + libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 \ + libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates \ + fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget + jobs: test: executor: @@ -13,7 +27,7 @@ jobs: default: ~/project type: string node-version: - default: '13' + default: '13.14' type: string setup: default: [] @@ -23,6 +37,7 @@ jobs: - steps: << parameters.setup >> - node/install-packages: app-dir: << parameters.app-dir >> + cache-key: yarn.lock pkg-manager: yarn - run: name: Run Tests @@ -30,17 +45,25 @@ jobs: working_directory: << parameters.app-dir >> workflows: - martix-tests: + test-matrix: jobs: - test: name: test/node:10 - node-version: '10' + node-version: '10.20' + setup: + - setup-headless-chrome - test: name: test/node:12 - node-version: '12' + node-version: '12.16' + setup: + - setup-headless-chrome - test: name: test/node:13 - node-version: '13' + node-version: '13.14' + setup: + - setup-headless-chrome - test: name: test/node:14 - node-version: '14' + node-version: '14.2' + setup: + - setup-headless-chrome