mirror of
https://github.com/wger-project/wger.git
synced 2026-02-18 00:17:51 +01:00
This has the effect, that the commands don't have an underscore anymore, but a dash (as had the parameters), which does look nicer Closes #482
55 lines
1.1 KiB
YAML
55 lines
1.1 KiB
YAML
language: python
|
|
dist: bionic
|
|
|
|
services:
|
|
- postgresql
|
|
|
|
# Cache the pip files
|
|
cache:
|
|
directories:
|
|
- $HOME/.cache/pip
|
|
- $HOME/.nvm
|
|
- node_modules
|
|
- wger/node_modules
|
|
|
|
# Python versions to test
|
|
python:
|
|
- "3.6"
|
|
- "3.7"
|
|
- "3.8"
|
|
|
|
node_js: 10
|
|
|
|
env:
|
|
- DB=postgresql
|
|
- DB=sqlite
|
|
|
|
# Install the application
|
|
install:
|
|
# Install requirements
|
|
- pip install -r requirements_devel.txt
|
|
- python setup.py develop
|
|
- cd wger
|
|
- if [[ "$DB" = "postgresql" ]]; then pip install psycopg2; fi
|
|
|
|
# Setup application
|
|
- if [[ "$DB" = "sqlite" ]]; then wger create-settings; fi
|
|
- if [[ "$DB" = "postgresql" ]]; then wger create-settings --database-type postgresql; fi
|
|
|
|
# change back to the source folder
|
|
- cd ..
|
|
|
|
# Create test databases
|
|
before_script:
|
|
- if [[ "$DB" = "postgresql" ]]; then psql -c 'DROP DATABASE IF EXISTS test_wger;' -U postgres; fi
|
|
- if [[ "$DB" = "postgresql" ]]; then psql -c 'CREATE DATABASE test_wger;' -U postgres; fi
|
|
|
|
# Do the tests
|
|
script:
|
|
|
|
# Regular application
|
|
- coverage run --source='.' ./manage.py test --parallel
|
|
|
|
# Code coverage
|
|
- coverage report
|