-
-
Notifications
You must be signed in to change notification settings - Fork 860
/
Copy path.travis.yml
executable file
·84 lines (73 loc) · 3.14 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
language: python
sudo: required
os: linux
dist: focal
virt: vm
services:
- docker
- xvfb
python:
- '3.9.21'
cache:
directories:
- $HOME/.cache/pip
env:
global:
- COMPOSE_BAKE=true
- COMPOSE_BAKE_ARGS="--build-arg PIP_NO_CACHE_DIR=1"
before_install:
- sudo rm -f /etc/boto.cfg
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- pip install --upgrade pip
- mkdir -p $HOME/.config/pip
- echo "[build_ext]" > $HOME/.config/pip/pip.conf
- echo "parallel = 1" >> $HOME/.config/pip/pip.conf
- ulimit -u 16384 # Increase process/thread limit
- ulimit -n 4096 # Increase open file limit
install:
- pip install awscli==1.18.66
jobs:
fast_finish: true
include:
- stage: Build, Test & Check Code Quality
name: Build, Test & Check Code Quality
script:
# Build steps
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || travis_terminate 1; fi
- docker-compose --profile worker --profile statsd build || travis_terminate 1;
# Frontend Tests
- docker-compose run nodejs bash -c "gulp dev && karma start --single-run && gulp staging" || travis_terminate 1;
# Backend Tests
- docker-compose run -e DJANGO_SETTINGS_MODULE=settings.test django python manage.py flush --noinput || travis_terminate 1;
- docker-compose run -e DJANGO_SETTINGS_MODULE=settings.test django pytest --cov . --cov-config .coveragerc || travis_terminate 1;
# Check Code Quality
- docker-compose run -e DJANGO_SETTINGS_MODULE=settings.dev -e VERBOSE=1 django bash -c "
echo 'Installing black, flake8, pylint and isort...' &&
pip install black==24.8.0 flake8==3.8.2 pylint==3.3.6 isort==5.12.0 &&
echo 'Running black check...' &&
black --check --diff ./ || { echo 'Black check failed!'; travis_terminate 1; } &&
echo 'Running isort check...' &&
isort --check-only --diff --profile=black ./ || { echo 'isort check failed!'; travis_terminate 1; } &&
echo 'Running flake8 check...' &&
flake8 --config=.flake8 ./ || { echo 'Flake8 check failed!'; travis_terminate 1; } &&
echo 'Running pylint check...' &&
pylint --rcfile=.pylintrc --output-format=colorized --score=y --fail-under=7.5 ./ || { echo 'Pylint check failed!'; travis_terminate 1; } &&
echo 'All code quality checks passed!'" || travis_terminate 1;
after_success:
- bash <(curl -s https://codecov.io/bash)
- coveralls --rcfile=.coveragerc
- stage: Package & Deployment
name: Push & Deploy Services
script:
- eval "$(ssh-agent -s)"
- openssl aes-256-cbc -K $encrypted_77d2d82026f6_key -iv $encrypted_77d2d82026f6_iv -in scripts/deployment/evalai.pem.enc -out scripts/deployment/evalai.pem -d || true
- ./scripts/deployment/push.sh || travis_terminate 1;
- ./scripts/deployment/deploy.sh auto_deploy || travis_terminate 1;
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
notifications:
email:
on_success: change
on_failure: always
slack: cloudcv:gy3CGQGNXLwXOqVyzXGZfdea