Skip to content

Commit

Permalink
Adding changes from #2559
Browse files Browse the repository at this point in the history
  • Loading branch information
JedWatson committed Apr 26, 2018
1 parent c6ef219 commit 503863b
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 33 deletions.
92 changes: 61 additions & 31 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,67 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:

docker_defaults: &docker_defaults
docker:
- image: circleci/node:8.4
- image: circleci/node:8.11.1-browsers
working_directory: ~/project/repo

working_directory: ~/repo
attach_workspace: &attach_workspace
attach_workspace:
at: ~/project

install_steps: &install_steps
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-
- checkout
- restore_cache:
name: Restore node_modules cache
keys:
- dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
- dependency-cache-{{ .Branch }}-
- dependency-cache-
- run:
name: Installing Dependencies
command: |
yarn install --silent
- save_cache:
name: Save node_modules cache
key: dependency-cache-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- node_modules/
- persist_to_workspace:
root: ~/project
paths:
- repo

- run: yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

# Start the examples server so that Cypress can run against them
- run: yarn start
# Install vxfb for Cypress
- run: yarn add xvfb
# Run eslint
- run: yarn lint
# Run tests
- run: yarn test
workflows:
version: 2
build_pipeline:
jobs:
- build
- unit_test:
requires:
- build
- end_to_end:
requires:
- build
jobs:
build:
<<: *docker_defaults
<<: *install_steps
unit_test:
<<: *docker_defaults
steps:
- *attach_workspace
- run:
name: Running unit tests
command: |
yarn lint
yarn test:jest
yarn coveralls
end_to_end:
<<: *docker_defaults
steps:
- *attach_workspace
- run:
name: Running E2E tests
command: |
yarn e2e
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ indent_size = 2

[*.md]
trim_trailing_whitespace = false

[.circleci/config.yml]
indent_size = 4
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"chroma-js": "^1.3.6",
"chrono-node": "^1.3.5",
"codesandboxer": "^0.1.1",
"concurrently": "^3.5.1",
"copy-webpack-plugin": "^4.3.1",
"coveralls": "^2.11.12",
"cross-env": "^5.1.3",
Expand Down Expand Up @@ -93,14 +94,14 @@
"scripts": {
"build": "nps build && bundlesize",
"watch": "nps build.watch",
"cover": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha",
"coveralls": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text mocha && cat coverage/lcov.info | coveralls",
"coveralls": "cat coverage/lcov.info | coveralls",
"lint": "eslint .",
"deploy": "cross-env NODE_ENV=production nps publish",
"start": "webpack-dev-server --progress",
"fresh": "rm -rf node_modules && yarn install",
"test": "npm run test:jest && npm run test:cypress",
"test:jest": "jest --coverage",
"e2e": "concurrently --kill-others --success=first --names 'SERVER,E2E' 'yarn start' 'yarn test:cypress'",
"test:cypress": "cypress run --spec ./cypress/integration/select_spec.js",
"test:cypress-watch": "node ./node_modules/.bin/cypress open",
"precommit": "flow check && lint-staged"
Expand Down

0 comments on commit 503863b

Please sign in to comment.