diff --git a/.circleci/config.yml b/.circleci/config.yml index ecfb2bb..fe15bb9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,25 +2,50 @@ version: 2 jobs: build: docker: - - image: circleci/node:8 - + - image: circleci/node:8-browsers working_directory: ~/repo - steps: - checkout - # Download and cache dependencies - restore_cache: keys: - v1-dependencies-{{ checksum "package.json" }} # fallback to using the latest cache if no exact match is found - v1-dependencies- - - - run: yarn install - + - run: + name: Install dependencies + command: yarn + - run: + name: Run unit tests with coverage + command: yarn test:coverage && cat ./tests/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js + - run: + name: Start functional tests server + command: yarn start:server + background: true + - run: + name: Wait for functional tests server to be initialized + command: | + TIMEOUT=30 + until curl 'http://localhost:8008/' > /dev/null 2>&1 || [ $TIMEOUT -eq 0 ]; do + echo "Waiting for functional tests server, $((TIMEOUT--)) remaining attempts..." + sleep 1 + done + - run: + name: Start selenium + command: yarn start:selenium + background: true + - run: + name: Wait for selenium to be initialized + command: | + TIMEOUT=30 + until curl 'http://localhost:4444/' > /dev/null 2>&1 || [ $TIMEOUT -eq 0 ]; do + echo "Waiting for selenium, $((TIMEOUT--)) remaining attempts..." + sleep 1 + done + - run: + name: Run functional tests + command: yarn test:functional - save_cache: paths: - node_modules key: v1-dependencies-{{ checksum "package.json" }} - - - run: yarn test:coverage && cat ./tests/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js