mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Rewrite build scripts
This commit is contained in:
parent
6beb87be2e
commit
36a171ca17
3 changed files with 82 additions and 47 deletions
15
.travis.yml
15
.travis.yml
|
|
@ -4,14 +4,13 @@ python:
|
|||
- "3.3"
|
||||
env:
|
||||
matrix:
|
||||
- DAV_SERVER=radicale RADICALE_BACKEND=filesystem REQUIREMENTS=release
|
||||
- DAV_SERVER=radicale RADICALE_BACKEND=filesystem REQUIREMENTS=devel
|
||||
- DAV_SERVER=radicale RADICALE_BACKEND=database REQUIREMENTS=devel
|
||||
- DAV_SERVER=owncloud REQUIREMENTS=release
|
||||
- BUILD=tests DAV_SERVER=radicale RADICALE_BACKEND=filesystem REQUIREMENTS=release
|
||||
- BUILD=tests DAV_SERVER=radicale RADICALE_BACKEND=filesystem REQUIREMENTS=devel
|
||||
- BUILD=tests DAV_SERVER=radicale RADICALE_BACKEND=database REQUIREMENTS=devel
|
||||
- BUILD=tests DAV_SERVER=owncloud REQUIREMENTS=release
|
||||
- BUILD=style
|
||||
|
||||
install:
|
||||
- "./install-deps.sh"
|
||||
- "pip install coveralls"
|
||||
- "./build.sh install"
|
||||
script:
|
||||
- "coverage run --source=vdirsyncer/,tests/ --module pytest"
|
||||
- "travis_retry coveralls"
|
||||
- "./build.sh run"
|
||||
|
|
|
|||
75
build.sh
Executable file
75
build.sh
Executable file
|
|
@ -0,0 +1,75 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
_testserver_from_repo() {
|
||||
# Maybe tmpfs is mounted on /tmp/, can't harm anyway.
|
||||
if [ ! -d $TESTSERVER_BASE$1/ ]; then
|
||||
git clone --depth=1 \
|
||||
https://github.com/untitaker/$1-testserver.git \
|
||||
/tmp/$1-testserver
|
||||
mkdir testservers
|
||||
ln -s /tmp/$1-testserver $TESTSERVER_BASE$1
|
||||
fi
|
||||
cd $TESTSERVER_BASE$1
|
||||
sh install.sh
|
||||
}
|
||||
|
||||
_install_testrunner() {
|
||||
$PIP_INSTALL pytest pytest-xprocess git+https://github.com/geier/leif
|
||||
}
|
||||
|
||||
_davserver_owncloud() {
|
||||
_testserver_from_repo owncloud
|
||||
}
|
||||
|
||||
_davserver_radicale() {
|
||||
_testserver_from_repo radicale
|
||||
}
|
||||
|
||||
|
||||
install_build_tests() {
|
||||
_install_testrunner
|
||||
_davserver_$DAV_SERVER
|
||||
}
|
||||
|
||||
run_build_tests() {
|
||||
coverage run --source=vdirsyncer/,tests/ --module pytest
|
||||
if [ "$TRAVIS" = "true" ]; then
|
||||
coveralls
|
||||
fi
|
||||
}
|
||||
|
||||
install_build_style() {
|
||||
$PIP_INSTALL flake8
|
||||
}
|
||||
|
||||
run_build_style() {
|
||||
flake8 vdirsyncer tests
|
||||
}
|
||||
|
||||
|
||||
[ -n "$BUILD" ] || BUILD=tests
|
||||
[ -n "$DAV_SERVER" ] || DAV_SERVER=radicale
|
||||
[ -n "$REQUIREMENTS" ] || REQUIREMENTS=release
|
||||
COMMAND="$1"
|
||||
TESTSERVER_BASE=./tests/storage/dav/servers/
|
||||
|
||||
install_builds() {
|
||||
echo "Installing for $BUILD"
|
||||
PIP_INSTALL="pip install"
|
||||
if [ "$TRAVIS" = "true" ]; then
|
||||
export CFLAGS=-O0 # speed up builds of packages which don't have wheels
|
||||
$PIP_INSTALL --upgrade wheel pip setuptools
|
||||
PIP_INSTALL="pip install --use-wheel --find-links=http://dev.unterwaditzer.net/vdirsyncer/wheels/"
|
||||
$PIP_INSTALL coveralls
|
||||
fi
|
||||
|
||||
$PIP_INSTALL --editable .
|
||||
install_build_$BUILD
|
||||
}
|
||||
|
||||
run_builds() {
|
||||
echo "Running $BUILD"
|
||||
run_build_$BUILD
|
||||
}
|
||||
|
||||
${COMMAND}_builds
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
[ -n "$DAV_SERVER" ] || DAV_SERVER=radicale
|
||||
[ -n "$REQUIREMENTS" ] || REQUIREMENTS=release
|
||||
TESTSERVER_BASE=./tests/storage/dav/servers/
|
||||
|
||||
PIP_INSTALL="pip install"
|
||||
if [ "$IS_TRAVIS" = "true" ]; then
|
||||
export CFLAGS=-O0 # speed up builds of packages which don't have wheels
|
||||
PIP_INSTALL="pip install --use-wheel --find-links=http://dev.unterwaditzer.net/vdirsyncer/wheels/"
|
||||
pip install --upgrade wheel pip setuptools
|
||||
fi
|
||||
|
||||
$PIP_INSTALL --editable .
|
||||
$PIP_INSTALL -r requirements.txt
|
||||
|
||||
|
||||
testserver_from_repo() {
|
||||
# Maybe tmpfs is mounted on /tmp/, can't harm anyway.
|
||||
if [ ! -d $TESTSERVER_BASE$1/ ]; then
|
||||
git clone --depth=1 \
|
||||
https://github.com/untitaker/$1-testserver.git \
|
||||
/tmp/$1-testserver
|
||||
mkdir testservers
|
||||
ln -s /tmp/$1-testserver $TESTSERVER_BASE$1
|
||||
fi
|
||||
cd $TESTSERVER_BASE$1
|
||||
sh install.sh
|
||||
}
|
||||
|
||||
davserver_owncloud() {
|
||||
testserver_from_repo owncloud
|
||||
}
|
||||
|
||||
davserver_radicale() {
|
||||
testserver_from_repo radicale
|
||||
}
|
||||
|
||||
davserver_$DAV_SERVER
|
||||
Loading…
Reference in a new issue