This repository has been archived by the owner on May 25, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 298
/
circle.yml
129 lines (102 loc) · 2.78 KB
/
circle.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
aliases:
- &restore-npm-cache
keys:
- v1-dependencies-{{ checksum "package-lock.json" }}
- v1-dependencies-master
- v1-dependencies-
- &restore-dist-cache
keys:
- v1-dist-{{ .Environment.CIRCLE_SHA1 }}
- v1-dist-master
- v1-dist-
version: 2
jobs:
install-dependencies:
docker:
- image: circleci/node:8.10
steps:
- checkout
- restore_cache: *restore-npm-cache
- run:
name: Install Node modules
command: npm i -ci
- save_cache:
key: v1-dependencies-{{ checksum "package-lock.json" }}
paths:
- node_modules
build:
docker:
- image: circleci/node:8.10
steps:
- checkout
- restore_cache: *restore-npm-cache
- run:
name: Build the app
command: npm run build
- save_cache:
key: v1-dist-{{ .Environment.CIRCLE_SHA1 }}
paths:
- build
lint:
docker:
- image: circleci/node:8.10
steps:
- checkout
- restore_cache: *restore-npm-cache
- run:
name: Run linter
command: npm run lint
test:
docker:
- image: circleci/node:8.10
steps:
- checkout
- restore_cache: *restore-npm-cache
- run:
name: Execute tests
command: npm test
coverage:
docker:
- image: circleci/node:8.10
steps:
- checkout
- restore_cache: *restore-npm-cache
- run:
name: Collect coverage
command: npm run coverage
- run:
name: Coveralls
command: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
sonarqube:
docker:
- image: circleci/node:8.10
steps:
- checkout
# SonarQube download, config and scanning
- run: echo "Starting SonarQube scan"
- run: wget https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-3.2.0.1227-linux.zip
- run: unzip sonar-scanner-cli-3.2.0.1227-linux.zip
- run: echo "sonar.host.url=https://sonarcloud.io" > sonar-scanner-3.2.0.1227-linux/conf/sonar-scanner.properties
- run: echo "sonar.login=$sonarqubekey" >> sonar-project.properties
- run: echo "sonar.organization=$sonarorg" >> sonar-project.properties
- run: sonar-scanner-3.2.0.1227-linux/bin/sonar-scanner
- run: echo "Scan complete, data sent to sonarcloud"
workflows:
version: 2
build-and-deploy:
jobs:
- install-dependencies
- test:
requires:
- install-dependencies
- lint:
requires:
- install-dependencies
- coverage:
requires:
- install-dependencies
- build:
requires:
- lint
- test
#- sonarqube