forked from sagemathinc/cocalc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
96 lines (82 loc) · 2.87 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
# CoCalc Travis-CI Configuration File
sudo: required
dist: bionic
# no need to build all branches
branches:
only:
- master
# there is no single language, but python is ok
language: "python"
python: 3.6
# travis natively supports 8 and 11 (as of winter 2018)
# version 10 should be installed via nvm
node_js:
- "10"
cache:
directories:
- "$HOME/.npm"
git:
depth: 3
# we want our database
services:
- postgresql
# specify postgres version and additional linux packages here
addons:
postgresql: "10"
apt:
update: true
packages:
- "python-pip"
- "python-yaml"
- "python-pytest"
- "python3-pip"
- "python3-pytest"
- "python3-yaml"
- "postgresql-server-dev-10" # pg_config https://docs.travis-ci.com/user/database-setup/#using-pg_config
# Travis supports "global" and "build matrix" variables
# http://docs.travis-ci.com/user/environment-variables/
env:
global: # note: we cannot use $VARs here
- REPORTER=min # for mocha tests
- PGUSER='smc'
matrix:
# this runs the "normal" tests, NODE_ENV installs devDependencies
- KUCALC_MODE=false NODE_ENV=development
# this just builds the webapp for production (full minifaction, all static pages, etc.)
- KUCALC_MODE=webapp NODE_ENV=production CC_COMP_ENV=true
# this compiles the hub, project, etc. and runs hubs in test mode
- KUCALC_MODE=services NODE_ENV=production CC_COMP_ENV=true
before_install: []
# installation and setup: make notes about the environment and init&start postgres
before_script:
- "source /etc/lsb-release"
- "pip -V"
- "pip3 -V"
- "python -V"
- "node --version"
- "pytest --version"
- "pg_config --version"
- 'export PGHOST="$TRAVIS_BUILD_DIR/src/dev/project/postgres_data/socket"'
- "python2 $TRAVIS_BUILD_DIR/src/dev/project/start_postgres.py &"
- "sleep 10" # for starting up postgres in the background (db init, etc.)
# the setup & compilation of CoCalc
# if broken, this will also trigger a test failure, i.e. that's also a test
install:
- "pip3 install --upgrade pytest PyYAML"
- "cd src"
- "source smc-env"
- 'if [[ $KUCALC_MODE != "services" ]]; then npm run make; fi'
- 'if [[ $KUCALC_MODE == "services" ]]; then "$TRAVIS_BUILD_DIR/.travis-install-services.sh"; fi'
# This is the actual testing, which runs in the same directory where `before_script` did end up in.
# A non-zero exit code indicates a failure.
# npm test is the usual, and coverage reporting is disabled
script:
- 'if [[ $KUCALC_MODE != "services" ]]; then "$TRAVIS_BUILD_DIR/.travis-test.sh"; fi'
- 'if [[ $KUCALC_MODE == "services" ]]; then "$TRAVIS_BUILD_DIR/.travis-test-services.sh"; fi'
# send coverage report over to https://coveralls.io
#after_success:
# - if [[ $MODE = "server" ]]; then sh -c 'cat ./coverage/lcov.info | ./node_modules/.bin/coveralls'; fi
notifications:
email:
on_success: change
on_failure: change