Merge pull request #1040 from paddatrapper/travis

Travis rewrite
This commit is contained in:
Robb 2020-05-22 15:25:51 -04:00 committed by GitHub
commit a9a1ec2ce3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 121 additions and 122 deletions

View File

@ -1,109 +1,86 @@
dist: xenial
version: ~> 1.0
language: php
php:
# the latest and greatest, has some issues that are excluded below in matrix.allow_failures
- 7.3
- 7.2
- 7.1
# the 7.0 build demonstrates that everything is basically ok for 7.0, users might want to wait for 7.1 to run it
- 7.0
# folks who prefer running on 5.x should be using 5.6 in most cases, 5.4 is no in the matrix since noone should use it
- 5.6
services:
- postgresql
- rabbitmq
- postgresql
env:
global:
- ENVIRONMENT=testing
- LIBRETIME_LOG_DIR=/tmp/log/libretime
jobs:
- PYTHON=false
- PYTHON=true
jobs:
allow_failures:
# there are currently some testing issues with DateTime precision on 7.1
- env: PYTHON=false
php: 7.1
# there are some issues with phpunit as well as some deep in zf1 on 7.2
- env: PYTHON=false
php: 7.2
# there are some issues with phpunit as well as some deep in zf1 on 7.3
- env: PYTHON=false
php: 7.3
exclude:
# we need to explicitly exclude python for every version of php other than 7.3 to make way to just run python tests in one seperate instance
- env: PYTHON=true
php: 7.2
- env: PYTHON=true
php: 7.1
- env: PYTHON=true
php: 7.0
- env: PYTHON=true
php: 5.6
- env: PYTHON=true
php: 5.4
- ENVIRONMENT=testing
- LIBRETIME_LOG_DIR=/tmp/log/libretime
addons:
apt:
packages:
- silan
- libgirepository1.0-dev
- gir1.2-gstreamer-1.0
- gstreamer1.0-plugins-base
- gstreamer1.0-plugins-good
- gstreamer1.0-plugins-bad
- gstreamer1.0-plugins-ugly
- libcairo2-dev
- liquidsoap
- liquidsoap-plugin-mad
- liquidsoap-plugin-taglib
- liquidsoap-plugin-flac
- liquidsoap-plugin-ogg
- liquidsoap-plugin-lame
- liquidsoap-plugin-faad
- liquidsoap-plugin-vorbis
- liquidsoap-plugin-opus
- python3
- python3-nose
- python3-gst-1.0
- python3-magic
- dos2unix
install:
- >
if [[ "$PYTHON" == false ]]; then
composer install
fi
- >
if [[ "$PYTHON" == true ]]; then
pyenv local 3.7
pip3 install -U pip wheel
pip3 install --user rgain3
pushd python_apps/airtime_analyzer
python3 setup.py install --dry-run --no-init-script
popd
fi
- gstreamer1.0-plugins-base
- gstreamer1.0-plugins-good
- gstreamer1.0-plugins-bad
- gstreamer1.0-plugins-ugly
- libgirepository1.0-dev
- liquidsoap
- liquidsoap-plugin-faad
- liquidsoap-plugin-lame
- liquidsoap-plugin-mad
- liquidsoap-plugin-vorbis
- python3-gst-1.0
- silan
jobs:
include:
- language: php
php: 7.3
stage: test
- language: php
php: 7.2
stage: test
- language: php
php: 7.1
stage: test
- language: php
php: 7.0
stage: test
- language: php
php: 5.6
stage: test
- language: python
python: 3.8
stage: test
- language: python
python: 3.7
stage: test
- language: python
python: 3.5
stage: test
- stage: deploy
addons:
apt:
packages:
dos2unix
script:
./travis/release.sh
deploy:
- provider: releases
token: $GITHUB_TOKEN
file: build/libretime-*.tar.gz
edge: true
on:
tags: true
allow_failures:
# https://github.com/LibreTime/libretime/issues/779
- language: php
php: 7.3
- language: php
php: 7.2
- language: php
php: 7.1
# https://github.com/LibreTime/libretime/issues/1041
- language: python
python: 3.5
install: ./travis/install.sh
before_script:
# prepare the database as per docs/testing.md
- psql -c 'CREATE DATABASE libretime;' -U postgres
- psql -c "CREATE USER libretime WITH PASSWORD 'libretime';" -U postgres
- psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;' -U postgres
- psql -c 'ALTER USER libretime CREATEDB;' -U postgres
- mkdir -p /tmp/log/libretime
script:
- ./travis/php.sh
- ./travis/python.sh
deploy:
- provider: script
skip_cleanup: true
script: ./travis/release.sh
on:
tags: true
condition: $PYTHON = true
- provider: releases
skip_cleanup: true
api_key: $GITHUB_TOKEN
file_glob: true
file: build/libretime-*.tar.gz
on:
tags: true
condition: $PYTHON = true
script: ./travis/test.sh

View File

@ -1,3 +1,4 @@
from pathlib import Path
from setuptools import setup
from subprocess import call
import os
@ -28,7 +29,9 @@ else:
def postinst():
if not no_init:
initd = Path("/etc/init.d/airtime-celery")
conf = Path("/etc/default/airtime-celery")
if not no_init and initd.is_file() and conf.is_file():
# Make /etc/init.d file executable and set proper
# permissions for the defaults config file
os.chmod("/etc/init.d/airtime-celery", 0o755)

25
travis/install.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
set -xe
if [[ -n "$TRAVIS_PHP_VERSION" ]]; then
composer install
fi
if [[ -n "$TRAVIS_PYTHON_VERSION" ]]; then
pyenv local $TRAVIS_PYTHON_VERSION
pushd python_apps/airtime_analyzer
pip3 install -e .
popd
pushd python_apps/airtime-celery
pip3 install -e .
popd
pushd python_apps/api_clients
pip3 install -e .
popd
pushd python_apps/pypo
pip3 install -e .
popd
fi

View File

@ -1,9 +0,0 @@
#!/bin/bash
set -xe
[[ "$PYTHON" == true ]] && exit 0
pushd airtime_mvc/tests
../../vendor/bin/phpunit
popd

View File

@ -1,16 +0,0 @@
#!/bin/bash
set -xe
[[ "$PYTHON" == false ]] && exit 0
pyenv local 3.7
pushd python_apps/airtime_analyzer
pip3 install -e .
nosetests
popd
pushd python_apps/api_clients
pip3 install -e .
nosetests
popd

19
travis/test.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/bash
set -xe
if [[ -n "$TRAVIS_PHP_VERSION" ]]; then
pushd airtime_mvc/tests
../../vendor/bin/phpunit
popd
fi
if [[ -n "$TRAVIS_PYTHON_VERSION" ]]; then
pyenv local $TRAVIS_PYTHON_VERSION
pushd python_apps/airtime_analyzer
nosetests
popd
pushd python_apps/api_clients
nosetests
popd
fi