This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
szurubooru/.travis.yml
2018-08-14 14:25:44 +09:00

151 lines
5.2 KiB
YAML

sudo: required
dist: trusty
services:
- postgresql
- elasticsearch
- docker
matrix:
include:
# ---- Backend test for on-premise / python 3.6 ----
- language: python
python:
- "3.6"
name: "Backend test for on-premise / python 3.6"
before_install:
- sudo apt-get -y install software-properties-common
- sudo add-apt-repository -y ppa:mc3man/trusty-media
- sudo apt-get update
- sudo apt-get -y --allow-unauthenticated install ffmpeg
- sudo -i -u postgres createuser szuru -D -R -S
- sudo -i -u postgres createdb szuru_test
- sudo -i -u postgres psql -c "ALTER USER szuru PASSWORD 'dog';"
- cd server
- cp config.yaml.dist config.yaml
- sed -i -e 's/^#debug:/debug:/' config.yaml
- sed -i -e 's/^#show_sql:/show_sql:/' config.yaml
- sed -i -e 's/^#data_url:/data_url:/' config.yaml
- sed -i -e 's/^#data_dir:/data_dir:/' config.yaml
- sed -i -e 's/^#database:$/database:\ postgres:\/\/szuru:dog@localhost:5432\/szuru_test/' config.yaml
- sed -i -e 's/^#elasticsearch:/elasticsearch:/' config.yaml
- sed -i -e 's/^# / /' config.yaml
install:
- pip install -r requirements.txt
- pip install -r dev-requirements.txt
script:
- ./wait-for-es
- alembic upgrade head
- py.test
# ---- Backend test for on-premise / python 3.7-dev ----
- language: python
python:
- "3.7-dev"
name: "Backend test for on-premise / python 3.7-dev"
before_install:
- sudo apt-get -y install software-properties-common
- sudo add-apt-repository -y ppa:mc3man/trusty-media
- sudo apt-get update
- sudo apt-get -y --allow-unauthenticated install ffmpeg
- sudo -i -u postgres createuser szuru -D -R -S
- sudo -i -u postgres createdb szuru_test
- sudo -i -u postgres psql -c "ALTER USER szuru PASSWORD 'dog';"
- cd server
- cp config.yaml.dist config.yaml
- sed -i -e 's/^#debug:/debug:/' config.yaml
- sed -i -e 's/^#show_sql:/show_sql:/' config.yaml
- sed -i -e 's/^#data_url:/data_url:/' config.yaml
- sed -i -e 's/^#data_dir:/data_dir:/' config.yaml
- sed -i -e 's/^#database:$/database:\ postgres:\/\/szuru:dog@localhost:5432\/szuru_test/' config.yaml
- sed -i -e 's/^#elasticsearch:/elasticsearch:/' config.yaml
- sed -i -e 's/^# / /' config.yaml
install:
- pip install -r requirements.txt
- pip install -r dev-requirements.txt
script:
- ./wait-for-es
- alembic upgrade head
- py.test
# ---- Backend test for docker ----
- language: python
name: "Backend test for docker"
env:
- DOCKER_COMPOSE_VERSION=1.22.0
before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- cp server/config.yaml.dist server/config.yaml
- cp docker-compose.yml.example docker-compose.yml
install:
- docker-compose pull
- docker-compose build --pull
- docker-compose up -d
# - docker-compose exec backend sh -c "echo '[tool:pytest]' > setup.cfg"
# - docker-compose exec backend sh -c "echo 'testpaths=szurubooru' >> setup.cfg"
# - docker-compose exec backend sh -c "echo 'addopts=--cov-report=term-missing --cov=szurubooru --tb=short' >> setup.cfg"
# - docker-compose exec backend sh -c "pip install --user pytest pytest-cov freezegun pycodestyle"
script:
- docker-compose exec backend sh -c "./wait-for-es"
- docker-compose exec backend sh -c "alembic upgrade head"
# - docker-compose exec backend sh -c "/opt/app/.local/bin/py.test"
# ---- Frontend test ugins npm / nodejs 6 ----
- language: node_js
node_js:
- "6"
name: "Frontend test ugins npm / nodejs 6"
install:
- cd client/
- npm install
script:
- node build.js
# ---- Frontend test ugins npm / nodejs 7 ----
- language: node_js
node_js:
- "7"
name: "Frontend test ugins npm / nodejs 7"
install:
- cd client/
- npm install
script:
- node build.js
# ---- Frontend test ugins npm / nodejs 8 ----
- language: node_js
node_js:
- "8"
name: "Frontend test ugins npm / nodejs 8"
install:
- cd client/
- npm install
script:
- node build.js
# ---- Frontend test ugins npm / nodejs 9 ----
- language: node_js
node_js:
- "9"
name: "Frontend test ugins npm / nodejs 9"
install:
- cd client/
- npm install
script:
- node build.js
# ---- Frontend test ugins yarn / nodejs 9 ----
- language: node_js
node_js:
- "9"
name: "Frontend test ugins yarn / nodejs 9"
before_install:
- npm install -g yarn
install:
- cd client/
- yarn install
script:
- node build.js