InvenTree/.travis.yml

53 lines
1.6 KiB
YAML
Raw Normal View History

dist: xenial
2020-09-01 11:01:38 +00:00
services:
- mysql
- postgresql
2017-03-23 21:34:41 +00:00
language: python
python:
- 3.6
2019-07-08 09:24:46 +00:00
- 3.7
addons:
apt-packages:
2020-02-02 00:52:22 +00:00
- sqlite3
2017-03-23 21:34:41 +00:00
before_install:
- sudo apt-get update
- sudo apt-get install gettext
2020-09-01 11:21:32 +00:00
- sudo apt-get install mysql-server libmysqlclient-dev
2020-09-01 11:24:19 +00:00
- sudo apt-get install libpq-dev
2020-08-21 11:27:39 +00:00
- pip3 install invoke
2020-09-01 11:13:38 +00:00
- pip3 install mysqlclient
- pip3 install psycopg2
2020-08-21 11:27:39 +00:00
- invoke install
- invoke migrate
2019-09-10 04:40:29 +00:00
- cd InvenTree && python3 manage.py createsuperuser --username InvenTreeAdmin --email admin@inventree.com --noinput && cd ..
2020-09-01 11:01:38 +00:00
- psql -c 'create database inventree_test_db;' -U postgres
2020-09-01 11:08:58 +00:00
- mysql -e 'CREATE DATABASE inventree_test_db;'
2017-03-23 21:34:41 +00:00
script:
2019-09-15 13:43:39 +00:00
- cd InvenTree && python3 manage.py makemigrations && cd ..
2019-09-15 13:42:36 +00:00
- python3 ci/check_migration_files.py
# Run unit testing / code coverage tests
2020-08-21 11:27:39 +00:00
- invoke coverage
# Run unit test for SQL database backend
- cd InvenTree && python3 manage.py test --settings=InvenTree.ci_mysql && cd ..
# Run unit test for PostgreSQL database backend
- cd InvenTree && python3 manage.py test --settings=InvenTree.ci_postgresql && cd ..
2020-08-21 11:27:39 +00:00
- invoke translate
- invoke style
# Create an empty database and fill it with test data
2020-11-12 11:04:50 +00:00
- rm inventree_default_db.sqlite3
- invoke migrate
- invoke import-fixtures
# Export database records
- invoke export-records -f data.json
# Create a new empty database and import the saved data
2020-11-12 11:04:50 +00:00
- rm inventree_default_db.sqlite3
- invoke migrate
- invoke import-records -f data.json
2019-04-24 05:32:50 +00:00
2019-04-24 05:36:45 +00:00
after_success:
2019-04-24 05:32:50 +00:00
- coveralls