1 | version: 2
|
2 | jobs:
|
3 | unit test:
|
4 | docker:
|
5 |
|
6 | - image: cimg/node:lts
|
7 | environment:
|
8 | TZ: "Europe/London"
|
9 | PG_CONNECTION_STRING: postgres://postgres:postgres@localhost:5432/circle_test
|
10 |
|
11 | - image: circleci/postgres:9.6-alpine-postgis
|
12 | environment:
|
13 | POSTGRES_USER: postgres
|
14 | POSTGRES_DB: circle_test
|
15 | working_directory: ~/repo
|
16 | steps:
|
17 | - checkout
|
18 | - run:
|
19 | name: install
|
20 | command: npm install
|
21 | - run:
|
22 | name: test
|
23 | command: npm test
|
24 | - run:
|
25 | name: codecov
|
26 | command: npm run coverage
|
27 | lint:
|
28 | docker:
|
29 | - image: cimg/node:lts
|
30 | working_directory: ~/repo
|
31 | steps:
|
32 | - checkout
|
33 | - run:
|
34 | name: install standard
|
35 | command: npm install
|
36 | - run:
|
37 | name: lint
|
38 | command: npm run lint
|
39 | release:
|
40 | docker:
|
41 |
|
42 | - image: cimg/node:lts
|
43 | environment:
|
44 | TZ: "Europe/London"
|
45 | working_directory: ~/repo
|
46 | steps:
|
47 | - checkout
|
48 | - run:
|
49 | name: install
|
50 | command: npm install
|
51 | - run:
|
52 | name: release
|
53 | command: npx semantic-release
|
54 | workflows:
|
55 | version: 2
|
56 | test_and_release:
|
57 | jobs:
|
58 | - unit test:
|
59 | context: tymly_global
|
60 | - lint
|
61 | - release:
|
62 | context: tymly_global
|
63 | requires:
|
64 | - unit test
|
65 | - lint
|
66 | filters:
|
67 | branches:
|
68 | only: master
|