forked from strapi/strapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
75 lines (62 loc) · 1.86 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
services:
- mongodb
- postgresql
- mysql
sudo: required
dist: trusty
language: node_js
node_js:
- '10'
cache:
directories:
- node_modules
- ~/.npm
- ~/.cache
# end to end testing template
e2e_tests: &e2e_tests
stage: 'End to End tests'
script:
- npm run -s test:generate-app -- $DB_STRING
- npm run -s test:start-app & wait-on http://localhost:1337
- npm run -s test:e2e
install:
- npm run setup:ci
- npm install -g wait-on
jobs:
include:
- stage: test
name: 'Lint / Snyk / Unit Tests '
script:
- npm run -s lint
- npm run -s test:snyk
- npm run -s test:unit
- npm run -s test:front
- <<: *e2e_tests
name: 'E2E Postgresql'
before_install:
- psql -c 'create database strapi_test;' -U postgres
env:
- DB_STRING='--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=postgres --dbpassword='
- <<: *e2e_tests
name: 'E2E Mysql'
before_install:
- 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'
env:
- DB_STRING='--dbclient=sqlite --dbfile=./tmp/data.db'
- <<: *e2e_tests
name: 'E2E MongoDB'
env:
- DB_STRING='--dbclient=mongo --dbhost=localhost --dbport=27017 --dbname=strapi_test --dbusername= --dbpassword='
- name: 'Cypress tests'
install:
- npm run setup:build
- npm install -g wait-on
- cypress install
script:
- npm run -s test:generate-app -- --dbclient=mongo --dbhost=localhost --dbport=27017 --dbname=strapi_test --dbusername= --dbpassword=
- npm run -s test:start-app & wait-on http://localhost:1337
- node test/cypress.js