From d2962ec0b2fe7a708c1da3564326966efadef78f Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sat, 13 Jan 2018 14:59:48 +0200 Subject: [PATCH] Add qt5.7 on travis ci --- .ci/install.sh | 30 ++++++++++++++++++ .ci/linux/create-packages.sh | 2 ++ .ci/linux/deploy.sh | 2 +- .ci/linux/install-deps.sh | 6 ---- .ci/macos/deploy.sh | 2 +- .ci/script.sh | 22 +++++++++++++ .travis.yml | 60 ++++++++++++++++++++---------------- 7 files changed, 89 insertions(+), 35 deletions(-) create mode 100755 .ci/install.sh delete mode 100755 .ci/linux/install-deps.sh create mode 100755 .ci/script.sh diff --git a/.ci/install.sh b/.ci/install.sh new file mode 100755 index 00000000..e7e99c1f --- /dev/null +++ b/.ci/install.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +set -ex + +if [ $TRAVIS_OS_NAME == osx ]; then + brew update + brew install qt5 lmdb clang-format ninja + + export CMAKE_PREFIX_PATH=/usr/local/opt/qt5 +fi + + +if [ $TRAVIS_OS_NAME == linux ]; then + + if [ -z "$QT_VERSION" ]; then + QT_VERSION="592" + fi + + export QT_PKG=${QT_VERSION:0:2} + + sudo add-apt-repository -y ppa:beineri/opt-qt${QT_VERSION}-trusty + sudo add-apt-repository -y ppa:george-edison55/cmake-3.x + sudo apt-get update -qq + sudo apt-get install -qq -y \ + qt${QT_PKG}base \ + qt${QT_PKG}tools \ + qt${QT_PKG}multimedia \ + cmake \ + liblmdb-dev +fi diff --git a/.ci/linux/create-packages.sh b/.ci/linux/create-packages.sh index 18e57769..00d80e93 100755 --- a/.ci/linux/create-packages.sh +++ b/.ci/linux/create-packages.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -ex + # # Create deb & rpm packages from the AppImage. # diff --git a/.ci/linux/deploy.sh b/.ci/linux/deploy.sh index 93566162..ddac478a 100755 --- a/.ci/linux/deploy.sh +++ b/.ci/linux/deploy.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -ex APP=nheko DIR=${APP}.AppDir diff --git a/.ci/linux/install-deps.sh b/.ci/linux/install-deps.sh deleted file mode 100755 index 0c0b61eb..00000000 --- a/.ci/linux/install-deps.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -sudo add-apt-repository -y ppa:beineri/opt-qt592-trusty -sudo add-apt-repository -y ppa:george-edison55/cmake-3.x -sudo apt-get update -qq -sudo apt-get install -qq -y qt59base qt59tools cmake liblmdb-dev qt59multimedia diff --git a/.ci/macos/deploy.sh b/.ci/macos/deploy.sh index 487b5be7..39e2f439 100755 --- a/.ci/macos/deploy.sh +++ b/.ci/macos/deploy.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -ex TAG=`git tag -l --points-at HEAD` diff --git a/.ci/script.sh b/.ci/script.sh new file mode 100755 index 00000000..8ad12745 --- /dev/null +++ b/.ci/script.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -ex + +if [ $TRAVIS_OS_NAME == linux ]; then + QT_PKG=${QT_VERSION:0:2} + source /opt/qt${QT_PKG}/bin/qt${QT_PKG}-env.sh || true; +fi + +make ci + +if [ $TRAVIS_OS_NAME == osx ]; then + make lint; + + if [ $DEPLOYMENT == 1 ] && [ ! -z $TRAVIS_TAG ]; then + make macos-deploy; + fi +fi + +if [ $TRAVIS_OS_NAME == linux ] && [ $DEPLOYMENT == 1 ] && [ ! -z $TRAVIS_TAG ]; then + make linux-deploy; +fi diff --git a/.travis.yml b/.travis.yml index 58ccbe02..caba1f0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,5 @@ +--- + language: cpp sudo: required dist: trusty @@ -14,48 +16,52 @@ matrix: osx_image: xcode9 compiler: clang env: - - DEPLOYMENT=1 + - DEPLOYMENT=1 - os: linux compiler: gcc env: - - CXX_COMPILER=g++-6 - - C_COMPILER=gcc-6 - - DEPLOYMENT=1 + - CXX_COMPILER=g++-6 + - C_COMPILER=gcc-6 + - QT_VERSION=592 + - DEPLOYMENT=1 addons: - apt: - sources: ["ubuntu-toolchain-r-test"] - packages: ["g++-6", "ninja-build"] + apt: + sources: ["ubuntu-toolchain-r-test"] + packages: ["g++-6", "ninja-build"] + - os: linux + compiler: gcc + env: + - CXX_COMPILER=g++-6 + - C_COMPILER=gcc-6 + - QT_VERSION=571 + addons: + apt: + sources: ["ubuntu-toolchain-r-test"] + packages: ["g++-6", "ninja-build"] - os: linux compiler: clang env: - - CXX_COMPILER=clang++-5.0 - - C_COMPILER=clang-5.0 + - CXX_COMPILER=clang++-5.0 + - C_COMPILER=clang-5.0 + - QT_VERSION=592 addons: - apt: - sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-5.0"] - packages: ["clang-5.0", "ninja-build"] + apt: + sources: ["ubuntu-toolchain-r-test", "llvm-toolchain-trusty-5.0"] + packages: ["clang-5.0", "ninja-build"] before_install: - export CXX=${CXX_COMPILER} - export CC=${C_COMPILER} install: - - if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install qt5 lmdb clang-format ninja; fi - - if [ $TRAVIS_OS_NAME == osx ]; then export CMAKE_PREFIX_PATH=/usr/local/opt/qt5; fi - - if [ $TRAVIS_OS_NAME == linux ]; then ./.ci/linux/install-deps.sh; fi - -before_script: - - if [ $TRAVIS_OS_NAME == linux ]; then source /opt/qt59/bin/qt59-env.sh; fi + - ./.ci/install.sh script: - - make ci - - if [ $TRAVIS_OS_NAME == osx ]; then make lint; fi - - if [ $TRAVIS_OS_NAME == osx ] && [ $DEPLOYMENT == 1 ] && [ ! -z $TRAVIS_TAG ]; then make macos-deploy; fi - - if [ $TRAVIS_OS_NAME == linux ] && [ $DEPLOYMENT == 1 ] && [ ! -z $TRAVIS_TAG ]; then make linux-deploy; fi + - ./.ci/script.sh before_deploy: - - export RELEASE_DEB_FILE=$(ls *.deb) - - export RELEASE_RPM_FILE=$(ls *.rpm) + - export RELEASE_DEB_FILE=$(ls *.deb) + - export RELEASE_RPM_FILE=$(ls *.rpm) deploy: - skip_cleanup: true @@ -65,9 +71,9 @@ deploy: secure: oprXzESukFiXBeF2BXkXUlegsAQc95Ub4kc/OkoNFaYBvqpA+IGpWHmHCx5JPny/OT3Kc2Urpe2JUeGSWDHZ7UCKDjH+NzGP3uN82fHh/HiszG/Srw7+hWEHm1ve+gMK9GS8pr+yUsUrPP0UfVXlPoI4pBWa4zGi2Ndb/SqvjCgIHFLtGyoBo6CydKQ/AyWiXSMKDfJL+Dx4JLIPP4RTCBJy8ZrZ8m/a5Tgy4Ij6+djjrgYCZCEhGxSYw7xDIT/9SV8g9NkrbisqBDrILzAH8Yhe4XMRMXo88OAxV5+Vb9Rw1hrqczez6lpFDbJetv8MjofND+pSoAFwtjaL1wTFK9Ud6w4O9AuHlEQH9cGVdvsxFcosRwJVh58x51JM9ptoktqhx/HHJBTuCHCYYlHwtRwbwqnMYdLzKZG5FnujT8DG+9mcva1fL6tzW/XD505VPMWwXFC/2/pvolgAkTFFXYSALAwZlK3IgoXU8Gok/3B4iHofzQsFf6Yq3BI/88x7tVASUqiYhoKrO50+gb6pNIRCyWgGUiBEVXBp6Ziq3ORQPyQJg7i9HHUGTUu74yvGLHWLwjNQzZP/hxJZK3VlJxzyXntdOxiJc8iOzNrU+rPKBAlAaE6bQDOoniIysEgdD5BXHTLFzPvts4P1n2Ckor5/rNJ+qXR8GU+/y7e1GKU= file_glob: true file: - - nheko-x86_64.AppImage - - $RELEASE_DEB_FILE - - $RELEASE_RPM_FILE + - nheko-x86_64.AppImage + - $RELEASE_DEB_FILE + - $RELEASE_RPM_FILE on: condition: $TRAVIS_OS_NAME == linux && $DEPLOYMENT == 1 repo: mujx/nheko