diff --git a/.travis.yml b/.travis.yml index e24fe63de..bc6f25797 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,37 +1,64 @@ -language: python +os: + - linux + - osx -python: - - "2.7" -virtualenv: - # required because we install the python-qt4 ubuntu package - system_site_packages: true +before_install: + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then + brew update; brew outdated xctool || brew upgrade xctool; + pip install virtualenv; + fi install: - # gui tests requirements - # start xvfb to emulate a graphical session - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - # install PyQt4 - - sudo apt-get update -qq - - sudo apt-get install python-qt4 pyqt4-dev-tools - # install mozregression code and test dependencies - - pip install -r requirements-gui-dev.txt + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then + export DISPLAY=:99.0; + sh -e /etc/init.d/xvfb start; + sudo apt-get update -qq; + sudo apt-get install python-qt4 pyqt4-dev-tools; + fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then + brew install pyqt; + brew linkapps qt; + MOZPATH="$PWD"; + mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages; + echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/travis/Library/Python/2.7/lib/python/site-packages/homebrew.pth; + export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH; + cd /usr/local/opt/pyqt/lib/python2.7/site-packages/PyQt4; + sudo install_name_tool -id $PWD/QtCore.so QtCore.so; + sudo install_name_tool -id $PWD/QtGui.so QtGui.so; + cd $MOZPATH; + fi + - virtualenv --system-site-packages venv + - source venv/bin/activate + - pip install -r requirements-gui-dev.txt script: - - ./check.py --with-coverage --with-gui + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then ./check.py --with-coverage --with-gui; fi + - if [ "$TRAVIS_OS_NAME" == "osx" ]; then ./check.py --with-gui; fi after_success: - - pip install coveralls - - coveralls + - if [ "$TRAVIS_OS_NAME" == "linux" ]; then pip install coveralls; coveralls; fi + before_deploy: - python gui/build.py bundle deploy: - provider: releases - api_key: - secure: GKlGCKzsjPyUVmtYZhOU0ggQH5RN5UgC+aEckfdguPLSnSeKxe3FLOV25zoe0+CLiYOHbsxvbTxB1fNh2KVxcrV7zroKzijhzFMAgfBP/yuCBeNWYR0tf/5qLk/xd26JQ+2Om6eyPnT+jc3JjmU7g8nYfEBrNDmtQ5Kmm0N4Crk= + - provider: releases + api-key: + secure: Fk4W2VGIKVdTnrqn984BgU5VWjHs9oQ/0ZHkld+dkjtJ3dHJ0aG8UXlXKEK5OcOCQjvHGyS+zeVuJwktCvZYw2J36YItNQZ5fDTIIpv5Zb8ZX9dD2XsOkR1urrHqiplyGMVwaGNQdtbZlkTxg6f28Jw+Rs/8f4ciCdEmGWmnSvds/WWGwzI+tqI53hK5j3wHJxVQI/aifYFdLFmsOt/G2X4R/KpyzON9rX53B27pd7hrLFbN8VM+n4xtEidLPXa6NHAEX03J0CmdnJkURHQxObDmwyk6aC2evurtmuZ6GxgOyo8QWXx7YJZBZPGUasB+SGLazQlnHXuywK77UR9luSFq+uLfJLFeP6JEU30sBP3TNxFOFJCtsUaX8IFM5GtS8pkRtT+hf//+X3pIouBoBOx3sBBGAAxmlV6bzlWXjXZOr1KAvXFyTsuhI2PXExGH725NiBlV9asVlkbJt7t5zHi9WZLLRMx5D5rq68NOWdyhIZAVVa4lQaAQxLpK2Fj3RRQvzwHqiZtESTdfwWjL9hkxO9IKhQmNuxRvEOnwLqDKB/K7badVKRasq886gs5AueI4dBrP7MdjDKtBpjweDQUjpJ3VaJFocJ1vNezm104AOYPVA9llDffu+2hlHIC3hNQ5GC3htSg4iJZtLKHAMRd/JS3ZhJfmstICrFzsUA4= + file: gui/dist/mozregression-gui.dmg + skip_cleanup: true + on: + tags: true + condition: + - $TRAVIS_OS_NAME == osx + + - provider: releases + api-key: + secure: Fk4W2VGIKVdTnrqn984BgU5VWjHs9oQ/0ZHkld+dkjtJ3dHJ0aG8UXlXKEK5OcOCQjvHGyS+zeVuJwktCvZYw2J36YItNQZ5fDTIIpv5Zb8ZX9dD2XsOkR1urrHqiplyGMVwaGNQdtbZlkTxg6f28Jw+Rs/8f4ciCdEmGWmnSvds/WWGwzI+tqI53hK5j3wHJxVQI/aifYFdLFmsOt/G2X4R/KpyzON9rX53B27pd7hrLFbN8VM+n4xtEidLPXa6NHAEX03J0CmdnJkURHQxObDmwyk6aC2evurtmuZ6GxgOyo8QWXx7YJZBZPGUasB+SGLazQlnHXuywK77UR9luSFq+uLfJLFeP6JEU30sBP3TNxFOFJCtsUaX8IFM5GtS8pkRtT+hf//+X3pIouBoBOx3sBBGAAxmlV6bzlWXjXZOr1KAvXFyTsuhI2PXExGH725NiBlV9asVlkbJt7t5zHi9WZLLRMx5D5rq68NOWdyhIZAVVa4lQaAQxLpK2Fj3RRQvzwHqiZtESTdfwWjL9hkxO9IKhQmNuxRvEOnwLqDKB/K7badVKRasq886gs5AueI4dBrP7MdjDKtBpjweDQUjpJ3VaJFocJ1vNezm104AOYPVA9llDffu+2hlHIC3hNQ5GC3htSg4iJZtLKHAMRd/JS3ZhJfmstICrFzsUA4= file: gui/mozregression-gui.tar.gz skip_cleanup: true on: - tags: true + tags: true + condition: + - $TRAVIS_OS_NAME == linux \ No newline at end of file diff --git a/gui/build.py b/gui/build.py index 1877c0d29..9ce300b7e 100644 --- a/gui/build.py +++ b/gui/build.py @@ -15,6 +15,7 @@ IS_WIN = os.name == 'nt' +IS_MAC = sys.platform == 'darwin' def call(*args, **kwargs): @@ -134,6 +135,11 @@ def do_bundle(options): if IS_WIN: makensis_path = os.path.join(options.nsis_path, "makensis.exe") call(makensis_path, 'wininst.nsi', cwd='wininst') + elif IS_MAC: + arg = ['hdiutil', 'create', 'dist/mozregression-gui.dmg', '-srcfolder'] + arg.append('dist/') + arg.append('-ov') + call(*arg) else: with tarfile.open('mozregression-gui.tar.gz', 'w:gz') as tar: tar.add(r'dist/')