Skip to content

Commit

Permalink
ci(circle): Swap out travis for CircleCI 2.0 config
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwiens committed Apr 2, 2018
1 parent 38bda7c commit 78ca637
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 34 deletions.
161 changes: 161 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
unit_tests: &unit_tests
steps:
- checkout
- setup_remote_docker
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: NPM Rebuild
command: npm install
- run:
name: Run unit tests.
command: npm run ci:test
canary_tests: &canary_tests
steps:
- checkout
- setup_remote_docker
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: NPM Rebuild
command: npm install
- run:
name: Install Webpack Canary
command: npm i --no-save webpack@next
- run:
name: Run unit tests.
command: npm run ci:test

version: 2
jobs:
dependency_cache:
docker:
- image: webpackcontrib/circleci-node-base:latest
steps:
- checkout
- setup_remote_docker
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Install Dependencies
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules

node8-latest:
docker:
- image: webpackcontrib/circleci-node8:latest
steps:
- checkout
- setup_remote_docker
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: NPM Rebuild
command: npm install
- run:
name: Run unit tests.
command: npm run ci:coverage
- run:
name: Submit coverage data to codecov.
command: bash <(curl -s https://codecov.io/bash)
when: on_success
node6-latest:
docker:
- image: webpackcontrib/circleci-node6:latest
<<: *unit_tests
node9-latest:
docker:
- image: webpackcontrib/circleci-node9:latest
<<: *unit_tests
node8-canary:
docker:
- image: webpackcontrib/circleci-node8:latest
<<: *canary_tests
analysis:
docker:
- image: webpackcontrib/circleci-node-base:latest
steps:
- checkout
- setup_remote_docker
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: NPM Rebuild
command: npm install
- run:
name: Run linting.
command: npm run lint
- run:
name: Run NSP Security Check.
command: npm run security
# - run:
# name: Validate Commit Messages
# command: npm run ci:lint:commits
publish:
docker:
- image: webpackcontrib/circleci-node-base:latest
steps:
- checkout
- setup_remote_docker
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: NPM Rebuild
command: npm install
# - run:
# name: Validate Commit Messages
# command: npm run release:validate
- run:
name: Publish to NPM
command: printf "noop running conventional-github-releaser"

version: 2.0
workflows:
version: 2
validate-publish:
jobs:
- dependency_cache
- node6-latest:
requires:
- dependency_cache
filters:
tags:
only: /.*/
- analysis:
requires:
- dependency_cache
filters:
tags:
only: /.*/
- node8-latest:
requires:
- analysis
- node6-latest
filters:
tags:
only: /.*/
- node9-latest:
requires:
- analysis
- node6-latest
filters:
tags:
only: /.*/
- node8-canary:
requires:
- analysis
- node6-latest
filters:
tags:
only: /.*/
- publish:
requires:
- node8-latest
- node9-latest
filters:
branches:
only:
- master
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/node_modules
.idea/
/coverage
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"devDependencies": {
"css-loader": "^0.28.0",
"file-loader": "^1.0.0",
"istanbul": "^0.4.5",
"jsdom": "^9.0.0",
"memory-fs": "^0.4.0",
"mocha": "^4.0.0",
Expand All @@ -30,7 +31,9 @@
},
"scripts": {
"test": "mocha",
"travis:test": "npm t",
"test:coverage": "istanbul cover node_modules/mocha/bin/_mocha",
"ci:test": "npm run test",
"ci:coverage": "npm run test:coverage",
"release": "standard-version"
},
"repository": "https://github.com/webpack-contrib/style-loader.git",
Expand Down

0 comments on commit 78ca637

Please sign in to comment.