version: 2.1 executors: linux: docker: - image: cimg/base:stable orbs: node: circleci/node@4.5.1 browser-tools: circleci/browser-tools@1.1.3 jobs: test: parameters: node-version: type: string browser: type: string always-pass: type: boolean executor: linux steps: - checkout - restore_cache: key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }} - node/install: node-version: << parameters.node-version >> - node/install-packages: override-ci-command: npm install - when: # Just to save time until caching saves the browser bin condition: equal: [ "FirefoxESR", <> ] steps: - browser-tools/install-firefox: version: "78.11.0esr" #https://archive.mozilla.org/pub/firefox/releases/ - when: # Just to save time until caching saves the browser bin condition: equal: [ "ChromeHeadless", <> ] steps: - browser-tools/install-chrome: replace-existing: false - save_cache: key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }} paths: - ~/.npm - ~/.cache - node_modules - run: npm run test:coverage -- --browsers=<> || <> - store_test_results: path: dist/reports/tests/ - store_artifacts: path: dist/reports/ workflows: matrix-tests: jobs: - test: name: node10-chrome node-version: lts/dubnium browser: ChromeHeadless always-pass: false - test: name: node12-firefoxESR node-version: lts/erbium browser: FirefoxESR always-pass: true - test: name: node14-chrome node-version: lts/fermium browser: ChromeHeadless always-pass: true