UNPKG

1.22 kBYAMLView Raw
1version: 2
2
3aliases:
4 - &restore-cache
5 restore_cache:
6 key: dependency-cache-{{ checksum "package.json" }}
7 - &install-deps
8 run:
9 name: Install dependencies
10 command: npm ci
11 - &build-packages
12 run:
13 name: Build
14 command: npm run build
15
16jobs:
17 build:
18 working_directory: ~/nest
19 docker:
20 - image: circleci/node:16
21 steps:
22 - checkout
23 - run:
24 name: Update NPM version
25 command: 'sudo npm install -g npm@latest'
26 - restore_cache:
27 key: dependency-cache-{{ checksum "package.json" }}
28 - run:
29 name: Install dependencies
30 command: npm ci
31 - save_cache:
32 key: dependency-cache-{{ checksum "package.json" }}
33 paths:
34 - ./node_modules
35 - run:
36 name: Build
37 command: npm run build
38 test:
39 working_directory: ~/nest
40 docker:
41 - image: circleci/node:16
42 steps:
43 - checkout
44 - *restore-cache
45 - *install-deps
46 - run:
47 name: Unit tests
48 command: npm run test
49
50workflows:
51 version: 2
52 build-and-test:
53 jobs:
54 - build
55 - test:
56 requires:
57 - build
58
\No newline at end of file