-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
69 lines (69 loc) · 1.77 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
language: node_js
sudo: required
apt:
# Add Chrome for running Angular tests
sources:
- google-chrome
packages:
- google-chrome-stable
- google-chrome-beta
node_js:
- "stable"
# Add Chrome for running Angular tests
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
install:
# Install the dependencies
- npm install
services:
# Add the PostgreSQL dependency
- postgresql
env:
# Set the environment variable as 'test'
- export NODE_ENV=test
before_script:
################################################
# BACKEND
# Go to the backend folder
- cd backend
# Install dependencies for the backend
- npm install
# Create a DB
- psql -c 'create database gesture_web_test;' -U postgres
# Install the Sequelize CLI globally
- npm install sequelize-cli -g
# Install the Sequelize CLI locally
- npm install --save sequelize
# Install the Sequelize CLI
- npm install sequelize-cli
# Copy the config.json file for Travis to a new file with the proper extension
- cp server/config/config.json.travis server/config/config.json
################################################
# FRONTEND
# Go to the frontend folder
- cd ../frontend/
# Copy environment file
- cp src/environments/environment.prod.ts src/environments/environment.ts
# Install the Angular CLI
- npm install -g angular-cli
# Install Karma
- npm install -g karma
# Install the for the frontend
- npm install
# Build the project
- ng build
script:
# Go to the backend folder
- cd ../backend
# Execute backend test script.
- npm test
# Execute backend linting script.
- npm run lint
# Go to the frontend folder
- cd ../frontend/
# Execute the Angular frontend tests a single time by setting the 'watch' flag to false.
- ng test --watch=false
# Execute the Angular linting script.
- ng lint