UNPKG

2.65 kBYAMLView Raw
1version: 2
2jobs:
3 unit test:
4 docker:
5 - image: cimg/node:lts
6 auth:
7 username: $DOCKERHUB_USERNAME
8 password: $DOCKERHUB_PASSWORD
9 environment:
10 TZ: "Europe/London"
11 PG_CONNECTION_STRING: postgres://postgres:postgres@localhost:5432/circle_test
12 - image: cimg/postgres:13.4-postgis
13 auth:
14 username: $DOCKERHUB_USERNAME
15 password: $DOCKERHUB_PASSWORD
16 environment:
17 POSTGRES_USER: postgres
18 POSTGRES_HOST_AUTH_METHOD: trust
19 POSTGRES_DB: circle_test
20 working_directory: ~/repo
21 steps:
22 - checkout
23 - restore_cache:
24 keys:
25 - v1-deps-{{ checksum "package.json" }}
26 - v1-deps-
27 - run:
28 name: install
29 command: npm install
30 - save_cache:
31 key: v1-deps-{{ checksum "package.json" }}
32 paths:
33 - node_modules
34 - run:
35 name: test
36 command: npm test
37 - run:
38 name: codecov
39 command: npm run coverage
40 lint:
41 docker:
42 - image: cimg/node:lts
43 auth:
44 username: $DOCKERHUB_USERNAME
45 password: $DOCKERHUB_PASSWORD
46 working_directory: ~/repo
47 steps:
48 - checkout
49 - run:
50 name: install standard
51 command: |
52 npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN
53 npm install
54 - run:
55 name: lint
56 command: npm run lint
57 release:
58 docker:
59 - image: cimg/node:lts
60 auth:
61 username: $DOCKERHUB_USERNAME
62 password: $DOCKERHUB_PASSWORD
63 environment:
64 TZ: "Europe/London"
65 working_directory: ~/repo
66 steps:
67 - checkout
68 - restore_cache:
69 keys:
70 - v1-deps-{{ checksum "package.json" }}
71 - v1-deps-
72 - run:
73 name: install
74 command: npm install
75 - save_cache:
76 key: v1-deps-{{ checksum "package.json" }}
77 paths:
78 - node_modules
79 - run:
80 name: release
81 command: |
82 chmod +x version_plugin
83 npx semantic-release
84workflows:
85 version: 2
86 test_and_release:
87 jobs:
88 - unit test:
89 context:
90 - docker-hub-creds
91 - build-env-vars
92 - lint:
93 context:
94 - docker-hub-creds
95 - build-env-vars
96 - release:
97 context:
98 - docker-hub-creds
99 - build-env-vars
100 requires:
101 - unit test
102 - lint
103 filters:
104 branches:
105 only: master