forked from TheBrainFamily/TheBrain2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
122 lines (117 loc) · 4.41 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
version: 2
jobs:
build:
docker:
- image: cypress/base:6
- image: circleci/mongo:3
working_directory: ~/TheBrain2.0
steps:
- checkout
- run:
name: Install wait-on
command: npm install -g wait-on
- run:
name: Create artifacts folders
command: |
mkdir -p ~/TheBrain2.0/server/artifacts
mkdir -p ~/TheBrain2.0/client/artifacts
mkdir -p ~/TheBrain2.0/mobileClient/artifacts
# - run: pushd ~/TheBrain2.0/server/
# - run: pushd ~/TheBrain2.0/server/ ; npm run startTestingDB
### SERVER
- restore_cache:
keys:
- npm-server-deps-{{ checksum "./server/package.json" }}
- run:
name: Install server packages
working_directory: "~/TheBrain2.0/server/"
command: npm install
- run:
name: Run server integration/unit tests
working_directory: "~/TheBrain2.0/server/"
command: npm test
environment:
- CI: true
- save_cache:
key: npm-server-deps-{{ checksum "./server/package.json" }}
paths:
- ~/TheBrain2.0/server/node_modules
- run:
name: Collect server integration/unit tests coverage
working_directory: "~/TheBrain2.0/server/artifacts"
command: ../node_modules/.bin/codecov -f lcov.info
environment:
- CODECOV_TOKEN: "c2740296-3f65-4994-beac-37a127192011"
- run:
name: Validate standard linting rules on server
working_directory: "~/TheBrain2.0/server/"
command: npm run standard -- > ~/TheBrain2.0/server/artifacts/standardLintingOutput.txt
### Web Client
- restore_cache:
keys:
- npm-client-deps-{{ checksum "./client/package.json" }}
- run:
name: Install Web Client packages
working_directory: "~/TheBrain2.0/client/"
command: npm install
- save_cache:
key: npm-client-deps-{{ checksum "./client/package.json" }}
paths:
- ~/TheBrain2.0/client/node_modules
- run:
name: Validate Standard linting rules on Web Client
working_directory: "~/TheBrain2.0/client/"
command: npm run standard -- > ~/TheBrain2.0/client/artifacts/standardLintingOutput.txt
### Mobile Client
- restore_cache:
keys:
- npm-mobileClient-deps-{{ checksum "./mobileClient/package.json" }}
- run:
name: Install Mobile Client packages
working_directory: "~/TheBrain2.0/mobileClient/"
command: npm install
- save_cache:
key: npm-mobileClient-deps-{{ checksum "./mobileClient/package.json" }}
paths:
- ~/TheBrain2.0/mobileClient/node_modules
- run:
name: Validate Standard linting rules on Mobile Client
working_directory: "~/TheBrain2.0/mobileClient/"
command: npm run standard -- > ~/TheBrain2.0/mobileClient/artifacts/standardLintingOutput.txt
### Testing package
- restore_cache:
keys:
- npm-testing-deps-{{ checksum "./package.json" }}
- run:
name: Install Testing package packages (sic!)
working_directory: "~/TheBrain2.0/"
command: npm install
- save_cache:
key: npm-testing-deps-{{ checksum "./package.json" }}
paths:
- ~/TheBrain2.0/node_modules
- run:
name: Enzyme almost-end to end tests for Web
working_directory: "~/TheBrain2.0/"
command: npm run enzymeTest
- run:
name: Enzyme almost-end to end tests for Mobile
working_directory: "~/TheBrain2.0/"
command: npm run enzymeTestMobile
- run:
name: Start the Web Client with "stateless" Server
working_directory: "~/TheBrain2.0/client"
command: npm run startForCypress
background: true
- run:
name: Wait for the Web Client to start up
command: wait-on "http://localhost:3000" -t 60000
- run:
name: Cypress Integration test (without starting up the server) for Web
working_directory: "~/TheBrain2.0/"
command: npm run cypressTestCI
- store_artifacts:
path: ~/TheBrain2.0/server/artifacts
path: ~/TheBrain2.0/client/artifacts
path: ~/TheBrain2.0/mobileClient/artifacts
path: ~/TheBrain2.0/cypress/videos