This repository has been archived by the owner on Mar 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
76 lines (66 loc) · 1.57 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
---
language: 'python'
services:
- 'mysql'
dist: xenial
# generic mysql init snippet for reuse below
.mysql_init: &mysql_init
>
mysql -uroot -e "
DROP DATABASE IF EXISTS ear_test;
CREATE DATABASE IF NOT EXISTS ear_test;
CREATE USER 'ear'@'localhost' IDENTIFIED BY 'ear';
GRANT ALL PRIVILEGES ON *.* TO 'ear'@'localhost' WITH GRANT OPTION;
"
stages:
- 'flake8'
- 'test'
- 'coverage'
- 'build'
python:
- '3.7'
cache:
pip: true
install:
- 'pip install -r ./server/requirements/test.txt'
script:
- *mysql_init
- 'pytest server/test'
jobs:
include:
- stage: 'flake8'
services: false
install:
- 'pip install flake8'
script:
- 'flake8 ./server/'
after_success: false
- stage: 'coverage'
install:
- 'pip install -r ./server/requirements/test.txt'
- 'pip install codecov'
script:
- *mysql_init
- 'pytest --cov=server server/test'
after_success:
- 'codecov --token=$CODECOV_TOKEN'
- stage: 'build'
cache:
yarn: true
directories:
- 'node_modules'
before_install:
- 'rm -fr ~/.yarn'
install:
- 'curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.12.3'
- 'export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"'
- 'yarn -v'
- 'nvm install v8.12.0'
- 'nvm use v8.12.0'
before_script:
- 'yarn -v'
- 'node -v'
script:
- 'cd client'
- 'yarn install'
- 'yarn build'