Skip to content

Commit

Permalink
Add CircleCI config (Agoric#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
katelynsills authored Mar 27, 2019
1 parent 99199a9 commit d4a4f04
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
version: 2.0

aliases:

install_npm_default: &install_npm
run:
name: Update npm
command: 'sudo npm install -g npm@latest'
restore_cache_default: &restore_cache # special step to restore the dependency cache
restore_cache:
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
key: dependency-cache-{{ checksum "package.json" }}
install_npm_packages_default: &install_npm_packages
run:
name: Install npm packages
command: npm install
save_cache_default: &save_cache # special step to save the dependency cache
save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ./node_modules

jobs:

# Lint and Test

lint_and_test_node_11: &lint_and_test
docker:
- image: circleci/node:11
steps:
- checkout
- *install_npm
- *restore_cache
- *install_npm_packages
- *save_cache
# We run the tests first because that builds the kernel as the
# first step
- run: &test
name: Test
command: npm test
- run: &lint
name: Lint
command: npm run lint-check


# Automated Npm Audit Fix PR

npm_audit_node_11: &npm_audit
docker:
- image: circleci/golang:1.12.0-node
steps:
- checkout
- run:
name: Update npm
command: 'sudo npm install -g npm@latest'
- run:
name: install hub
command: |
set -xe
go get -u -d github.com/github/hub
cd /go/src/github.com/github/hub
go install github.com/github/hub
- run:
name: Submit PR if npm audit fix makes changes
command: ./scripts/npm-audit-fix.sh


workflows:
version: 2
test_all:
jobs:
- lint_and_test_node_11
nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- npm_audit_node_11

0 comments on commit d4a4f04

Please sign in to comment.