/
config.yml
63 lines (60 loc) · 1.84 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
version: 2
jobs:
Filesize:
docker:
- image: cimg/node:16.8
steps:
- checkout
- restore_cache:
keys:
# When lock file changes, use increasingly general patterns to
# restore cache
- npm-v3-{{ .Branch }}-{{ checksum "package-lock.json" }}
- npm-v3-{{ .Branch }}-
- npm-v3-
- run: npm version
- run: npm ci
- save_cache:
key: npm-v3-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths:
# This should cache the npm cache instead of node_modules, which is
# needed because npm ci actually removes node_modules before
# installing to guarantee a clean slate.
- ~/.npm
- run: npm run bundlesize
Tests:
docker:
- image: cimg/node:16.8
steps:
- checkout
- restore_cache:
keys:
# When lock file changes, use increasingly general patterns to
# restore cache
- npm-v3-{{ .Branch }}-{{ checksum "package-lock.json" }}
- npm-v3-{{ .Branch }}-
- npm-v3-
- run: npm version
- run: npm ci
- save_cache:
key: npm-v3-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths:
# This should cache the npm cache instead of node_modules, which is
# needed because npm ci actually removes node_modules before
# installing to guarantee a clean slate.
- ~/.npm
- run:
name: Jest suite with coverage
command: npm run test:ci
environment:
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
- store_test_results:
path: reports/junit
- store_artifacts:
path: reports/junit
workflows:
version: 2
Build and Test:
jobs:
- Filesize
- Tests