forked from loopbackio/loopback-next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
145 lines (126 loc) · 3.97 KB
/
.travis.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
language: node_js
os:
- linux
node_js:
- "10"
- "12"
- "14"
- "15"
script:
- npm run postinstall
- npm run build
- npm run test:ci
# Increase the memory to 2G for node
env: TASK=test NODE_OPTIONS="--max-old-space-size=2048"
cache:
yarn: true
before_install:
- npm i -g yarn
- yarn --version
- |
NPMVER=`npm --version`
if [ ${NPMVER/\.*/} = 7 ]
then
echo "Downgrading bundled npm version $NPMVER to v6"
npm i -g npm@6
else
echo "Using bundled npm version $NPMVER"
fi
- npm --version
install: npm ci --ignore-scripts
after_success:
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]] && [[ $(echo $TRAVIS_NODE_VERSION | cut -d'.' -f1) == "10" ]]; then npm run coverage:ci; fi
branches:
only:
- master
jobs:
include:
- node_js: "12"
os: osx
# using the default script to build & run the tests
- node_js: "12"
os: linux
env: TASK=code-lint
# Running Code Linter -- Requires @loopback/build so it's bootstrapped
# We actually need to bootstrap all packages, otherwise typescript-eslint
# is not able to access type information for dependencies
script:
- lerna bootstrap
- npm run build
- npm run lint
- npm run check-package-metadata
- node_js: "12"
os: linux
env: TASK=commit-lint
script: commitlint-travis
- node_js: "12"
os: linux
env: TASK=verify-docs
# The default npm for node v12.16.1 (npm v6.13.4) fails with cb() never called
before_install: npm i -g npm
script:
- lerna bootstrap
- npm run build
- npm run --prefix docs version
- ./bin/verify-doc-changes.sh
- node_js: "12"
os: linux
env:
- TASK=test-repository-mongodb
services:
- mongodb
script:
- lerna bootstrap --scope "@loopback/test-repository-mongodb" --include-dependencies
- cd acceptance/repository-mongodb && npm test
- node_js: "12"
os: linux
env:
- TASK=test-repository-mysql
- MYSQL_USER=test
- MYSQL_PASSWORD=test
services:
- mysql
before_install:
- mysql -u root -e "CREATE USER 'test'@'localhost' IDENTIFIED BY 'test';"
- mysql -e "use mysql; update user set authentication_string=PASSWORD('test') where User='test'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
- mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' WITH GRANT OPTION;FLUSH PRIVILEGES;"
- mysql -e "GRANT SUPER ON *.* TO 'test'@'localhost' IDENTIFIED BY 'test';FLUSH PRIVILEGES;"
script:
- lerna bootstrap --scope "@loopback/test-repository-mysql" --include-dependencies
- cd acceptance/repository-mysql && npm test
- node_js: "12"
os: linux
env:
- TASK=test-repository-postgresql
- POSTGRESQL_USER=postgres
services:
- postgresql
script:
- lerna bootstrap --scope "@loopback/test-repository-postgresql" --include-dependencies
- psql -U postgres -a -f acceptance/repository-postgresql/test/schema.sql
- cd acceptance/repository-postgresql && npm test
- node_js: "12"
os: linux
env:
- TASK=test-repository-cloudant
script:
# set up docker image and create admin for cloudant.
- lerna bootstrap --scope "@loopback/test-repository-cloudant" --include-dependencies
- cd acceptance/repository-cloudant && sh setup.sh
- npm test
- node_js: "12"
os: linux
env:
- TASK=test-extension-logging-fluentd
services:
- docker
script:
- lerna bootstrap --scope "@loopback/test-extension-logging-fluentd" --include-dependencies
- cd acceptance/extension-logging-fluentd && npm test
- node_js: "12"
os: linux
env:
- TASK=test-benchmark
script:
- lerna bootstrap --scope "@loopback/benchmark" --include-dependencies
- cd benchmark && npm test