Port CI script changes from master

This commit is contained in:
Kovid Goyal 2017-05-10 00:26:45 +05:30
parent 8246e539bc
commit 547b0ce83c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 16 additions and 25 deletions

View File

@ -1,6 +1,6 @@
language: node_js language: node_js
nodejs: nodejs:
- 6 - node
cache: cache:
directories: directories:
- node_modules - node_modules
@ -10,19 +10,10 @@ matrix:
include: include:
- os: linux - os: linux
sudo: false sudo: false
env:
- SW=$HOME/sw PATH=$SW/bin:$PATH CFLAGS=-I$SW/include LDFLAGS=-L$SW/lib LD_LIBRARY_PATH=$SW/qt/lib:$SW/lib PKG_CONFIG_PATH=$SW/lib/pkgconfig QMAKE=$SW/qt/bin/qmake QT_PLUGIN_PATH=$SW/qt/plugins
- os: osx - os: osx
env:
# On OS X the frameworks/dylibs contain hard coded paths, so we have to re-create the paths in the VM exactly
- SWBASE=/sw SW=$SWBASE/sw PATH=$SW/bin:$SW/qt/bin:$SW/python/Python.framework/Versions/2.7/bin:$PWD/node_modules/.bin:$PATH CFLAGS=-I$SW/include LDFLAGS=-L$SW/lib QMAKE=$SW/qt/bin/qmake QT_PLUGIN_PATH=$SW/qt/plugins
before_install: before_install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir -p $SW && curl https://download.calibre-ebook.com/travis/linux-64.tar.xz | tar xJ -C $SW; fi - python setup/unix-ci.py install
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo mkdir -p $SW && sudo chown -R $USER $SWBASE; fi - python setup/unix-ci.py bootstrap
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl https://download.calibre-ebook.com/travis/osx.tar.xz | tar xJ -C $SW; fi
- npm install --no-optional rapydscript-ng && echo $PATH && which rapydscript && rapydscript --version
- python setup.py bootstrap --ephemeral
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export SSL_CERT_FILE=$PWD/resources/mozilla-ca-certs.pem; fi
script: python setup.py test script: python setup/unix-ci.py test

View File

@ -21,7 +21,7 @@ def setenv(key, val):
if isosx: if isosx:
SWBASE = '/Users/kovid' SWBASE = '/sw'
SW = SWBASE + '/sw' SW = SWBASE + '/sw'
def install_env(): def install_env():
@ -38,8 +38,10 @@ if isosx:
setenv('QT_PLUGIN_PATH', '$SW/qt/plugins') setenv('QT_PLUGIN_PATH', '$SW/qt/plugins')
else: else:
SW = os.path.expanduser('~/sw')
def install_env(): def install_env():
setenv('SW', '$HOME/sw') setenv('SW', SW)
setenv('PATH', '$SW/bin:$PATH') setenv('PATH', '$SW/bin:$PATH')
setenv('CFLAGS', '-I$SW/include') setenv('CFLAGS', '-I$SW/include')
setenv('LDFLAGS', '-L$SW/lib') setenv('LDFLAGS', '-L$SW/lib')
@ -88,17 +90,15 @@ def main():
action = sys.argv[1] action = sys.argv[1]
if action == 'install': if action == 'install':
if isosx: if isosx:
run('sudo', 'mkdir', '-p', SWBASE) run('sudo', 'mkdir', '-p', SW)
run('sudo', 'chown', os.environ['USER'], SWBASE) run('sudo', 'chown', '-R', os.environ['USER'], SWBASE)
download_and_decompress( tball = 'osx'
'https://download.calibre-ebook.com/travis/sw-osx.tar.bz2',
SWBASE
)
else: else:
download_and_decompress( tball = 'linux-64'
'https://download.calibre-ebook.com/travis/sw-linux.tar.xz', os.makedirs(SW)
os.path.expanduser('~') download_and_decompress(
) 'https://download.calibre-ebook.com/travis/{}.tar.xz'.format(tball), SW
)
run('npm install --no-optional rapydscript-ng') run('npm install --no-optional rapydscript-ng')
print(os.environ['PATH']) print(os.environ['PATH'])