Skip to content

Commit

Permalink
chore: update circle ci config to use re-useable commands (#424)
Browse files Browse the repository at this point in the history
* chore: update circle ci config to use re-useable commands.

* squash: add branch filters
  • Loading branch information
lholmquist committed Mar 26, 2020
1 parent e6e77fa commit a2c22e7
Showing 1 changed file with 32 additions and 34 deletions.
66 changes: 32 additions & 34 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,53 @@
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
version: 2.1

build-common: &common-build
working_directory: ~/repo
commands:
test-nodejs:
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-

steps:
- checkout
- run: npm install

# 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-
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- run: npm install

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

# run tests!
- run: npm run ci
# run tests!
- run: npm run ci

jobs:
node10:
docker:
- image: circleci/node:10
<<: *common-build

filters:
branches:
ignore:
- gh-pages
steps:
- test-nodejs

node12:
docker:
- image: circleci/node:12
<<: *common-build

filters:
branches:
ignore:
- gh-pages
steps:
- test-nodejs

workflows:
version: 2
test_node_versions:
jobs:
- node10
- node12
- node10:
filters:
branches:
ignore:
- gh-pages
- node12:
filters:
branches:
ignore:
- gh-pages

0 comments on commit a2c22e7

Please sign in to comment.