Skip to content

Commit

Permalink
Setup circleci config
Browse files Browse the repository at this point in the history
  • Loading branch information
Wil Wilsman committed Oct 3, 2018
1 parent 42df30d commit c20c98f
Show file tree
Hide file tree
Showing 4 changed files with 12,626 additions and 1 deletion.
173 changes: 173 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
version: 2.0

jobs:
checkout-and-install:
docker:
- image: circleci/node:10
steps:
- checkout
- restore_cache:
key: package-v1-{{ checksum "package.lock" }}
- run:
name: Install dependencies
command: yarn install
- persist_to_workspace:
root: ~/
paths: project
- save_cache:
key: package-v1-{{ checksum "yarn.lock" }}
paths:
- ~/project/node_modules

eslint:
docker:
- image: circleci/node:10
steps:
- attach_workspace:
at: ~/
- run:
name: Lint JS
command:
yarn eslint
--max-warnings=0
--format junit
--output-file ./artifacts/eslint/eslint.xml
- store_test_results:
path: ./artifacts
- store_artifacts:
path: ./artifacts

stylelint:
docker:
- image: circleci/node:10
steps:
- attach_workspace:
at: ~/
- run:
name: Set up artifacts directory
command: mkdir -p artifacts/stylelint
- run:
name: Lint CSS
command:
yarn --silent stylelint
--custom-formatter './node_modules/stylelint-junit-formatter' > ./artifacts/stylelint/stylelint.xml
- store_test_results:
path: ./artifacts
- store_artifacts:
path: ./artifacts

build:
docker:
- image: circleci/node:10
steps:
- attach_workspace:
at: ~/
- run:
name: Build storybook bundle
command: yarn storybook-build
- store_artifacts:
path: ./.out

test-chrome:
docker:
- image: circleci/node:10-browsers
steps:
- attach_workspace:
at: ~/
- run:
name: Run tests
command:
yarn test
--coverage
--karma.singleRun
--karma.browsers=Chrome
--karma.reporters mocha junit
--karma.junitReporter.outputDir artifacts/junit/karma
- store_test_results:
path: ./artifacts/junit
- store_artifacts:
path: ./artifacts

test-firefox:
docker:
- image: circleci/node:10-browsers
steps:
- attach_workspace:
at: ~/
- run:
name: Run tests
command:
yarn test
--karma.singleRun
--karma.browsers=Firefox
--karma.reporters mocha junit
--karma.junitReporter.outputDir artifacts/junit/karma
- store_test_results:
path: ./artifacts/junit
- store_artifacts:
path: ./artifacts

test-safari:
docker:
- image: circleci/node:10
steps:
- attach_workspace:
at: ~/
- run:
name: Run tests
command:
yarn test
--karma.singleRun
--karma.browsers=bs_safari_11
--karma.reporters mocha junit BrowserStack
--karma.junitReporter.outputDir artifacts/junit/karma
- store_test_results:
path: ./artifacts/junit
- store_artifacts:
path: ./artifacts

test-edge:
docker:
- image: circleci/node:10
steps:
- attach_workspace:
at: ~/
- run:
name: Run tests
command:
yarn test
--karma.singleRun
--karma.browsers=bs_ieEdge_windows
--karma.reporters mocha junit BrowserStack
--karma.junitReporter.outputDir artifacts/junit/karma
- store_test_results:
path: ./artifacts/junit
- store_artifacts:
path: ./artifacts

workflows:
version: 2
push:
jobs:
- checkout-and-install
- eslint:
requires:
- checkout-and-install
- stylelint:
requires:
- checkout-and-install
- build:
requires:
- checkout-and-install
- test-chrome:
requires:
- checkout-and-install
- test-firefox:
requires:
- checkout-and-install
- test-safari:
requires:
- checkout-and-install
- test-edge:
requires:
- checkout-and-install
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
yarn.lock
.DS_Store
yarn-error.log
/artifacts
35 changes: 35 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = (config) => {
const configuration = {
browserStack: {
project: 'stripes-smart-components'
},

browserDisconnectTimeout: 3e5,
browserDisconnectTolerance: 3,
browserNoActivityTimeout: 3e5,
captureTimeout: 3e5,

customLaunchers: {
bs_safari_11: {
base: 'BrowserStack',
os: 'OS X',
os_version: 'High Sierra',
browser: 'safari',
browser_version: '11.1'
},
bs_ieEdge_windows: {
base: 'BrowserStack',
browser: 'edge',
browser_version: '15.0',
os: 'Windows',
os_version: '10'
}
}
};

// BrowserStack launcher isn't automatically added by Stripes CLI
configuration.plugins = config.plugins;
configuration.plugins.push('karma-browserstack-launcher');

config.set(configuration);
};
Loading

0 comments on commit c20c98f

Please sign in to comment.