Enable CI for macOS and Windows

This commit is contained in:
Victor Tran 2018-07-26 16:44:29 +10:00
parent c3307cd5c5
commit 598470fbda
6 changed files with 76 additions and 4 deletions

View file

@ -1,10 +1,20 @@
language: cpp
os:
- linux
- osx
before_install:
- sudo apt-get update -qq
- sudo apt-get install libqt5core5a libqt5dbus5 libqt5gui5 libqt5x11extras5 qtchooser qt5-default
- export STAGE=before_install
- ./travis.sh
script:
- qmake
- make
- export STAGE=script
- ./travis.sh
compiler:
- gcc
dist: xenial
sudo: required
branches:
except:
- # Do not build tags that we create when we upload to GitHub Releases
- /^(?i:continuous)/

18
appveyor.yml Normal file
View file

@ -0,0 +1,18 @@
version: 1.0.{build}
branches:
only:
- blueprint
skip_tags: true
image: Visual Studio 2017
environment:
REPO_SLUG: vicr123/the-libs
deploy_project: the-libs
deploy_version: ''
deploy_artifact: ''
build_script:
- cmd: >-
appveyor\build.bat
test: off

10
appveyor/build.bat Normal file
View file

@ -0,0 +1,10 @@
if "%APPVEYOR_REPO_TAG_NAME%"=="continuous" (
exit 1
)
set QTDIR=C:\Qt\5.11\msvc2017_64
set PATH=%PATH%;%QTDIR%\bin
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
qmake the-libs.pro
nmake release
nmake install

View file

@ -56,6 +56,8 @@ unix:!macx {
macx {
target.path = /usr/local/lib
header.path = /usr/local/include/the-libs
SOURCES += tnotification/tnotification-mac.cpp
}
win32 {

View file

@ -0,0 +1,5 @@
#include "tnotification.h"
void tNotification::post(bool deleteWhenDone) {
}

27
travis.sh Normal file
View file

@ -0,0 +1,27 @@
if [ $STAGE = "script" ]; then
if [ $TRAVIS_OS_NAME = "linux" ]; then
echo "[TRAVIS] Running qmake"
qmake
echo "[TRAVIS] Building project"
make
else
echo "[TRAVIS] Building for macOS"
export PATH="/usr/local/opt/qt/bin:$PATH"
cd ..
mkdir "build-thelibs"
cd "build-thelibs"
echo "[TRAVIS] Running qmake"
qmake "INCLUDEPATH += /usr/local/opt/qt/include" "LIBS += -L/usr/local/opt/qt/lib" ../the-libs/the-libs.pro
echo "[TRAVIS] Building project"
make
fi
elif [ $STAGE = "before_install" ]; then
if [ $TRAVIS_OS_NAME = "linux" ]; then
sudo apt-get update -qq
sudo apt-get install libqt5core5a libqt5dbus5 libqt5gui5 libqt5x11extras5 qtchooser qt5-default
else
echo "[TRAVIS] Preparing to build for macOS"
brew update
brew install qt5
fi
fi