.gitlab-ci.yml 1.58 KB
Newer Older
David Haynes's avatar
David Haynes committed
1
2
3
4
5
6
7
services:
  - mysql:latest

variables:
  MYSQL_DATABASE: wopen
  MYSQL_ROOT_PASSWORD: root

8
9
10
11
12
types:
  - test

before_script:
  - apt-get update -qy
David Haynes's avatar
David Haynes committed
13
  - apt-get install -y mysql-client libmysqlclient-dev python-mysqldb  
14
15
  - pip install -r requirements/test.txt
  - cd whats_open/
David Haynes's avatar
David Haynes committed
16
  - export WOPEN_SECRET_KEY=$(dd if=/dev/urandom count=100 | tr -dc "A-Za-z0-9" | fold -w 60 | head -n1 2>/dev/null)
17
18
  - export WOPEN_EMAIL_DOMAIN="@masonlive.gmu.edu"
  - export WOPEN_DB_NAME="wopen"
19
20
  - export WOPEN_DB_USER="root"
  - export WOPEN_DB_PASSWORD="root"
21
22
23
  - export WOPEN_DB_HOST="mysql"
  - export WOPEN_DB_PORT=3306
  - export WOPEN_SUPERUSER=admin
24
25
26
27
28
29
30
31
32
33
  - python manage.py makemigrations
  - python manage.py makemigrations website
  - python manage.py migrate
  - echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('root', 'root@srct.gmu.edu', 'root') " | python manage.py shell

whats-open-py2.7:
  image: library/python:2.7
  type: test
  script:
    - python manage.py test
34
35
36
37
38
39
40
41
42
43
44
45

whats-open-py3.5:
  image: library/python:3.5
  type: test
  script:
    - python manage.py test

whats-open-py3.6:
  image: library/python:3.6
  type: test
  script:
    - python manage.py test
46
    - if pip list --outdated --format=legacy | grep "Latest" | wc -l > 0; then echo "Please update your dependecies!" && pip list --outdated --format=legacy && exit 1; else exit 0; fi
47
48
    - coverage run --source=website --omit=*migrations/*,*admin.py,*__init__.py,*.pyc manage.py test
    - coverage html -i && grep pc_cov htmlcov/index.html | egrep -o "[0-9]+\%" | awk '{ print "covered " $1;}'