1 | version: 2
|
2 | jobs:
|
3 | test:
|
4 | docker:
|
5 | # use node:lts
|
6 | - image: cimg/node:lts
|
7 | environment:
|
8 | TZ: "Europe/London"
|
9 | PG_CONNECTION_STRING: postgres://postgres:postgres@localhost:5432/circle_test
|
10 | # use postgres 9.6
|
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 | release:
|
28 | docker:
|
29 | # use node:lts
|
30 | - image: cimg/node:lts
|
31 | environment:
|
32 | TZ: "Europe/London"
|
33 | working_directory: ~/repo
|
34 | steps:
|
35 | - checkout
|
36 | - run:
|
37 | name: install
|
38 | command: npm install
|
39 | - run:
|
40 | name: release
|
41 | command: |
|
42 | chmod +x version_plugin
|
43 | npx semantic-release
|
44 | workflows:
|
45 | version: 2
|
46 | test_and_release:
|
47 | jobs:
|
48 | - test:
|
49 | context: tymly_global
|
50 | - release:
|
51 | context: tymly_global
|
52 | requires:
|
53 | - test
|
54 | filters:
|
55 | branches:
|
56 | only: master
|