-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.travis.yml
29 lines (23 loc) · 1.58 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
sudo: required
language: python
python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
cache: pip
services:
- mysql
- postgresql
env:
- TEST_DRIVER=mysql MYSQL_HOST=127.0.0.1 MYSQL_USER=root MYSQL_PASSWD='' MYSQL_DB=test MYSQL_CHARSET=utf8
- TEST_DRIVER=postgres POSTGRESQL_HOST=127.0.0.1 POSTGRESQL_USER=postgres POSTGRESQL_PASSWD='' POSTGRESQL_DB=test
install: "pip install -e ."
before_script:
- sh -c "if [ '$TEST_DRIVER' = 'mysql' ]; then mysql -e \"create database IF NOT EXISTS test;use test;CREATE TABLE IF NOT EXISTS test (id int(11) NOT NULL AUTO_INCREMENT,data varchar(64) NOT NULL,count int(11) NOT NULL DEFAULT '0',created_at datetime NOT NULL DEFAULT '1970-01-01 00:00:00',updated_at datetime NOT NULL DEFAULT '1970-01-01 00:00:00', PRIMARY KEY (id));\" -h127.0.0.1 -uroot; fi"
- sh -c "if [ '$TEST_DRIVER' = 'postgres' ]; then psql -c 'DROP DATABASE IF EXISTS test;' -U postgres; fi"
- sh -c "if [ '$TEST_DRIVER' = 'postgres' ]; then psql -c \"CREATE DATABASE test;\" -U postgres; fi"
- sh -c "if [ '$TEST_DRIVER' = 'postgres' ]; then psql -c \"CREATE SEQUENCE test_id INCREMENT 1 MINVALUE 1 MAXVALUE 4294967295 CACHE 1;\" -U postgres -d test; fi"
- sh -c "if [ '$TEST_DRIVER' = 'postgres' ]; then psql -c \"CREATE TABLE test(id integer NOT NULL DEFAULT nextval('test_id'::regclass),data character varying(64) NOT NULL,count integer NOT NULL,created_at timestamp without time zone NOT NULL,updated_at timestamp without time zone NOT NULL,CONSTRAINT test_pkey PRIMARY KEY (id)) TABLESPACE pg_default;\" -U postgres -d test; fi"
- pip install -r requirements.dev.txt
script: ./run-tests