-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
53 lines (46 loc) · 1.37 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
services:
- docker
language: node_js
node_js:
- 14
cache:
# Caches $HOME/.npm when npm ci is default script command
# Caches node_modules in all other cases
npm: true
directories:
# we also need to cache folder with Cypress binary
- ~/.cache
before_install:
- npm install -g cypress@5.3.0
- npm install -g wait-on
# Add cypress-related packages
- sudo apt-get update
- sudo apt -y install libgconf2-4
script:
- docker-compose -f docker-compose.prod.yml up -d
- wait-on http://localhost:3000/
- cypress run --project ./frontend
# Stop all processes to be able to bind to ports for specific unit tests
- docker-compose down
# Run the backend tests
- docker-compose -f docker-compose.prod.yml run backend npm test
# Copy over the files to the container
- docker-compose -f docker-compose.prod.yml run -v ${PWD}/new_build:/var/www/app/mnt frontend /bin/sh copy_files.sh
env: TZ=America/Chicago
after_success:
# Set the CI environment variables needed for codecov
- ci_env=`bash <(curl -s https://codecov.io/env)`
# Run codecov with specified environment variables
- docker-compose run $ci_env backend npm run coverage
deploy:
- provider: pages
verbose: true
cleanup: true
local_dir: new_build/
token: $GITHUB_TOKEN
on:
branch: master
- provider: script
script: bash deploy.sh
on:
branch: master