-
Notifications
You must be signed in to change notification settings - Fork 922
/
config.yml
80 lines (74 loc) · 1.92 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
version: 2.1
orbs:
snyk: snyk/snyk@0.0.8
references:
container: &container
docker:
- image: circleci/node:12.13.0-browsers
environment:
CHROME_PATH: /usr/bin/google-chrome
restore_deps: &restore_deps
restore_cache:
keys:
- v2-uswds-dependencies-{{ checksum "package-lock.json" }}
jobs:
build:
<<: *container
steps:
- checkout
- run:
name: Install codeclimate
command: sudo npm install -g codeclimate-test-reporter
- restore_cache:
keys:
- v2-uswds-dependencies-{{ checksum "package-lock.json" }}
- run: npm install
- save_cache:
paths:
- node_modules
key: v2-uswds-dependencies-{{ checksum "package-lock.json" }}
- snyk/scan:
organization: uswds
- run:
name: Run test
command: npm run test:ci
- run:
name: Run code coverage report
command: npm run cover
- run:
name: Checking build
command: |
if [[ $(echo "$CIRCLE_BRANCH" | grep -c "pull") -le 0 ]]; then
ls -agolf dist/
codeclimate-test-reporter < coverage/lcov.info
fi
deploy:
<<: *container
steps:
- checkout
- restore_cache:
keys:
- v2-uswds-dependencies-{{ checksum "package-lock.json" }}
- run: npm install --ignore-scripts
- run: npm rebuild node-sass
- run:
name: Build the USWDS package
command: npm run release
- run:
name: Publish to NPM
command: |
npm config set "//registry.npmjs.org/:_authToken=$NPM_TOKEN"
npm publish
- snyk/scan:
organization: uswds
workflows:
version: 2
circle-uswds:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: master