forked from strapi/strapi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
101 lines (87 loc) · 3.01 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
services:
- postgresql
- mysql
addons:
postgresql: '11.2'
env:
global:
- PGPORT=5433
dist: xenial
language: node_js
node_js:
- '10'
cache:
yarn: true
directories:
- node_modules
# end to end testing template
e2e_tests: &e2e_tests
stage: 'End to End tests'
script:
- yarn run -s test:generate-app -- $DB_STRING
- yarn run -s test:start-app & wait-on http://localhost:1337
- yarn run -s test:e2e
before_script:
- yarn build
- yarn global add -g wait-on
- yarn global add codecov
jobs:
include:
- stage: test
name: Snyk
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
script: yarn run -s test:snyk
if: fork = false
- stage: test
name: 'Lint / Unit Tests '
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
script:
- yarn run -s lint
- yarn run -s test:unit --coverage && codecov -C -F unit
- yarn run -s test:front && codecov -C -F front
- <<: *e2e_tests
name: 'E2E Postgresql'
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
- sudo apt-get update
- sudo apt-get --yes remove postgresql-*
- sudo apt-get install -y postgresql-11 postgresql-client-11
- sudo cp /etc/postgresql/{9.6,11}/main/pg_hba.conf
- sudo service postgresql restart 11
- psql -c 'create database strapi_test;' -U postgres
env:
- DB_STRING='--dbclient=postgres --dbhost=localhost --dbport=5433 --dbname=strapi_test --dbusername=postgres --dbpassword='
- <<: *e2e_tests
name: 'E2E Mysql'
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
- sudo cp $TRAVIS_BUILD_DIR/_travis/mysql.cnf /etc/mysql/conf.d/
- sudo service mysql restart
- mysql -e 'CREATE DATABASE strapi_test;'
env:
- DB_STRING='--dbclient=mysql --dbhost=localhost --dbport=3306 --dbname=strapi_test --dbusername=travis --dbpassword='
- <<: *e2e_tests
name: 'E2E Sqlite'
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
env:
- DB_STRING='--dbclient=sqlite --dbfile=./tmp/data.db'
- <<: *e2e_tests
name: 'E2E MongoDB'
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
- wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.6.6.tgz
- tar -zxvf mongodb-linux-x86_64-3.6.6.tgz
- mkdir -p ./data/db/27017
- mkdir -p ./data/db/27000
- ./mongodb-linux-x86_64-3.6.6/bin/mongod --fork --dbpath ./data/db/27017 --syslog --port 27017
env:
- DB_STRING='--dbclient=mongo --dbhost=localhost --dbport=27017 --dbname=strapi_test --dbusername= --dbpassword='