From d3e3015e8dce56a9d5db3f25f1af22cb56eed6b3 Mon Sep 17 00:00:00 2001 From: pimlie Date: Sat, 23 Mar 2019 15:27:10 +0100 Subject: [PATCH] test(circleci): update to 2.1 config --- .circleci/config.yml | 174 ++++++++++++++++++------------------------- 1 file changed, 71 insertions(+), 103 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b511df3..dc6248b 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,157 +1,96 @@ -version: 2 +version: 2.1 -defaults: &defaults - working_directory: ~/project - docker: - - image: circleci/node:latest - environment: - NODE_ENV: test +executors: + node: + parameters: + browsers: + type: boolean + default: false + docker: + - image: circleci/node:latest<<# browsers >>-browsers<> + working_directory: ~/project + environment: + NODE_ENV: test + +commands: + attach-project: + steps: + - checkout + - attach_workspace: + at: ~/project jobs: setup: - <<: *defaults + executor: node steps: - # Checkout repository - checkout - - # Restore cache - restore_cache: key: yarn-{{ checksum "yarn.lock" }} - - # Install dependencies - run: name: Install Dependencies command: NODE_ENV=dev yarn - - # Keep cache - save_cache: key: yarn-{{ checksum "yarn.lock" }} paths: - "node_modules" - - # Persist workspace - persist_to_workspace: root: ~/project paths: - node_modules lint: - <<: *defaults + executor: node steps: - - checkout - - attach_workspace: - at: ~/project + - attach-project - run: name: Lint command: yarn lint audit: - <<: *defaults + executor: node steps: - - checkout - - attach_workspace: - at: ~/project + - attach-project - run: name: Security Audit command: yarn audit test-unit: - <<: *defaults + executor: node steps: - - checkout - - attach_workspace: - at: ~/project + - attach-project - run: name: Unit Tests command: yarn test:unit --coverage && yarn coverage test-e2e-ssr: - <<: *defaults + executor: node steps: - - checkout - - attach_workspace: - at: ~/project + - attach-project - run: - name: E2E Tests + name: E2E SSR Tests command: yarn test:e2e-ssr - # Persist workspace - persist_to_workspace: root: ~/project paths: - test/fixtures - test-e2e-firefox: - <<: *defaults - docker: - - image: circleci/node:latest-browsers + test-e2e-browser: + parameters: + browserString: + type: string + executor: + name: node + browsers: true steps: - - checkout - - attach_workspace: - at: ~/project + - attach-project - run: - name: E2E Tests + name: E2E Browser Tests command: yarn test:e2e-browser environment: - BROWSER_STRING: firefox/headless + BROWSER_STRING: << parameters.browserString >> - test-e2e-chrome: - <<: *defaults - docker: - - image: circleci/node:latest-browsers - steps: - - checkout - - attach_workspace: - at: ~/project - - run: - name: E2E Tests - command: yarn test:e2e-browser - environment: - BROWSER_STRING: chrome/selenium - - test-e2e-ie: - <<: *defaults - docker: - - image: circleci/node:latest-browsers - steps: - - checkout - - attach_workspace: - at: ~/project - - run: - name: E2E Tests - command: yarn test:e2e-browser - environment: - BROWSER_STRING: browserstack/local/ie:9 - - test-e2e-edge: - <<: *defaults - docker: - - image: circleci/node:latest-browsers - steps: - - checkout - - attach_workspace: - at: ~/project - - run: - name: E2E Tests - command: yarn test:e2e-browser - environment: - BROWSER_STRING: browserstack/local/edge:15 - - test-e2e-safari: - <<: *defaults - docker: - - image: circleci/node:latest-browsers - steps: - - checkout - - attach_workspace: - at: ~/project - - run: - name: E2E Tests - command: yarn test:e2e-browser - environment: - BROWSER_STRING: browserstack/local/os x=snow leopard/safari:5.1 - workflows: - version: 2 + version : 2 commit: jobs: @@ -160,5 +99,34 @@ workflows: - audit: { requires: [setup] } - test-unit: { requires: [lint] } - test-e2e-ssr: { requires: [lint] } - - test-e2e-firefox: { requires: [test-e2e-ssr] } - - test-e2e-ie: { requires: [test-e2e-ssr] } + - test-e2e-browser: + browserString: firefox/headless + requires: + - test-e2e-ssr + - test-e2e-browser: + browserString: chrome/selenium + requires: + - test-e2e-ssr + - test-e2e-browser: + browserString: browserstack/local/ie:9 + requires: + - test-e2e-ssr + filter: + brances: + ignore: /^pull\/.*/ + - test-e2e-browser: + browserString: browserstack/local/edge:15 + requires: + - test-e2e-ssr + filter: + brances: + ignore: /^pull\/.*/ + - test-e2e-browser: + browserString: browserstack/local/os x=snow leopard/safari:5.1 + requires: + - test-e2e-ssr + filter: + brances: + ignore: /^pull\/.*/ + +