forked from open-telemetry/opentelemetry-js-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
179 lines (169 loc) · 4.9 KB
/
config.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
version: 2
node_test_env: &node_test_env
RUN_POSTGRES_TESTS: 1
RUN_MYSQL_TESTS: 1
RUN_MONGODB_TESTS: 1
RUN_REDIS_TESTS: 1
POSTGRES_USER: postgres
POSTGRES_DB: circle_database
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
OPENTELEMETRY_REDIS_HOST: 'localhost'
OPENTELEMETRY_REDIS_PORT: 6379
MONGODB_HOST: localhost
MONGODB_DB: opentelemetry-tests
MONGODB_PORT: 27017
MYSQL_USER: otel
MYSQL_PASSWORD: secret
MYSQL_DATABASE: circle_database
MYSQL_PORT: 3306
NPM_CONFIG_UNSAFE_PERM: true
postgres_service: &postgres_service
image: circleci/postgres:9.6-alpine
environment: # env to pass to CircleCI, specified values must match node_test_env
POSTGRES_USER: postgres
POSTGRES_DB: circle_database
redis_service: &redis_service
image: redis
mongo_service: &mongo_service
image: mongo
mysql_service: &mysql_service
image: circleci/mysql:5.7
environment:
MYSQL_USER: otel
MYSQL_PASSWORD: secret
MYSQL_DATABASE: circle_database
MYSQL_ROOT_PASSWORD: rootpw
cache_1: &cache_1
key: npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}
paths:
- ./node_modules
- ./package-lock.json
- plugins/node/opentelemetry-plugin-dns/node_modules
- plugins/node/opentelemetry-plugin-ioredis/node_modules
- plugins/node/opentelemetry-plugin-mongodb/node_modules
- plugins/node/opentelemetry-plugin-redis/node_modules
- plugins/node/opentelemetry-plugin-pg/node_modules
- plugins/node/opentelemetry-plugin-document-load/node_modules
- plugins/node/opentelemetry-plugin-pg-pool/node_modules
- plugins/node/opentelemetry-plugin-mysql/node_modules
- plugins/node/opentelemetry-plugin-express/node_modules
- propagators/opentelemetry-propagator-jaeger/node_modules
node_unit_tests: &node_unit_tests
resource_class: large
steps:
- checkout
- run:
name: Create Checksum
command: sh .circleci/checksum.sh /tmp/checksums.txt
- run:
name: Setup environment variables
command: |
echo "export CIRCLE_NODE_VERSION=\$(node --version | grep -oE 'v[0-9]+')" >> $BASH_ENV
source $BASH_ENV
- run:
name: Log out node.js version
command: |
node --version
echo "CIRCLE_NODE_VERSION=${CIRCLE_NODE_VERSION}"
- restore_cache:
keys:
- npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-F267A71D
- run:
name: Install Root Dependencies
command: npm install --ignore-scripts
- run:
name: Boostrap dependencies
command: npx lerna bootstrap --no-ci
- save_cache:
<<: *cache_1
- run:
name: Unit tests
command: npm run test
- run:
name: report coverage
command: if [ "${CIRCLE_NODE_VERSION}" = "v12" ]; then npm run codecov; fi
browsers_unit_tests: &browsers_unit_tests
resource_class: large
steps:
- checkout
- run:
name: Create Checksum
command: sh .circleci/checksum.sh /tmp/checksums.txt
- run:
name: Setup environment variables
command: |
echo "export CIRCLE_NODE_VERSION=\$(node --version | grep -oE 'v[0-9]+')" >> $BASH_ENV
source $BASH_ENV
- run:
name: Log out node.js version
command: |
node --version
echo "CIRCLE_NODE_VERSION=${CIRCLE_NODE_VERSION}"
- restore_cache:
keys:
- npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-F267A71D
- run:
name: Install Root Dependencies
command: npm install --ignore-scripts
- run:
name: Boostrap dependencies
command: npx lerna bootstrap --no-ci
- save_cache:
<<: *cache_1
- run:
name: Unit tests
command: npm run test:browser
- run:
name: report coverage
command: if [ "$CIRCLE_NODE_VERSION" = "v12" ]; then npm run codecov:browser; fi
jobs:
node8:
docker:
- image: node:8
environment: *node_test_env
- *postgres_service
- *mysql_service
- *redis_service
- *mongo_service
<<: *node_unit_tests
node10:
docker:
- image: node:10
environment: *node_test_env
- *postgres_service
- *mysql_service
- *redis_service
- *mongo_service
<<: *node_unit_tests
node12:
docker:
- image: node:12
environment: *node_test_env
- *postgres_service
- *mysql_service
- *redis_service
- *mongo_service
<<: *node_unit_tests
node14:
docker:
- image: node:14
environment: *node_test_env
- *postgres_service
- *mysql_service
- *redis_service
- *mongo_service
<<: *node_unit_tests
node12-browsers:
docker:
- image: circleci/node:12-browsers
<<: *browsers_unit_tests
workflows:
version: 2
build:
jobs:
- node8
- node10
- node12
- node14
- node12-browsers