Skip to content

Commit

Permalink
ci: test build matrix, upload etc
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Apr 27, 2015
1 parent e6d6c9a commit 6101549
Show file tree
Hide file tree
Showing 10 changed files with 151 additions and 10 deletions.
33 changes: 24 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
os:
- linux
- osx
# TODO: osx must manually request http://docs.travis-ci.com/user/multi-os/
language: cpp
compiler:
- clang
cache: apt
install: true
env:
- FFMPEG=ffmpeg-2.2.5
global:
- LANG="en_US.UTF-8"
matrix:
- QT=4.8.6 AV=ffmpeg-1.0.10
- QT=5.0.2 AV=ffmpeg-1.2.10
- QT=5.1.1 AV=ffmpeg-2.0.6
- QT=5.2.1 AV=ffmpeg-2.2.11
# - QT=5.3.1 AV=ffmpeg-2.4.4
allow_failures:
- os: osx

branches:
only:
- master
- prelease
- ci

before_script:
- sudo apt-get update -qq
- sudo apt-get install -qq -y portaudio19-dev libopenal-dev libva-dev libass-dev libxv-dev parallel
git:
submodules: true

install: . tools/ci/$TRAVIS_OS_NAME/install.sh

script:
- ./tools/ci/travis_build.sh $FFMPEG
- ./tools/ci/$TRAVIS_OS_NAME/script.sh
after_success: ./tools/ci/$TRAVIS_OS_NAME/after_success.sh

notifications:
irc:
channels:
Expand All @@ -24,7 +43,3 @@ notifications:
- [email protected]
on_success: change
on_failure: always
env:
- LANG="en_US.UTF-8"
os:
- linux
25 changes: 25 additions & 0 deletions tools/ci/after_success.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
set -ev

# download ifw for linux, mingw

# upload packages

# TRAVIS_TAG
echo TRAVIS_TAG=$TRAVIS_TAG

PKG=$QTAV_OUT-$TRAVIS_JOB_NUMBER.tar.xz
tar Jcvf $PKG $QTAV_OUT/{bin,lib*,build.log}

wget http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz/download -O sshpass.tar.gz
tar zxf sshpass.tar.gz
cd sshpass-1.05
./configure
make
sudo make install
export PATH=$PWD:$PATH
cd $TRAVIS_BUILD_DIR
type -a sshpass
# ignore known hosts: -o StrictHostKeyChecking=no
sshpass -p $SF_PWD scp -o StrictHostKeyChecking=no $PKG $SF_USER@frs.sourceforge.net:/home/frs/project/qtav/ci
#rsync --password-file=$PWF -avP -e ssh $PKG [email protected]:/home/frs/project/qtav/ci/
#curl -H "Accept: application/json" -X PUT -d "default=linux&default=bsd&default=solaris" -d "api_key=$SF_API_KEY" https://sourceforge.net/projects/qtav/files/ci/$PKG
1 change: 1 addition & 0 deletions tools/ci/linux/after_success.sh
22 changes: 22 additions & 0 deletions tools/ci/linux/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
set -ev
sudo apt-get update -qq
sudo apt-get install -qq -y portaudio19-dev libpulse-dev libopenal-dev libva-dev libass-dev libxv-dev parallel
# TODO: do not use apt, use the latest code instead

wget http://sourceforge.net/projects/qtav/files/depends/FFmpeg/linux/${AV}-linux-x86+x64.tar.xz/download -O ${AV}-linux-x86+x64.tar.xz
tar Jxf ${AV}-linux-x86+x64.tar.xz


wget http://sourceforge.net/projects/buildqt/files/lite/Qt${QT}-Linux64.tar.xz/download -O Qt${QT}-Linux64.tar.xz
tar -I xz -xf Qt${QT}-Linux64.tar.xz

export FFMPEG_DIR=$PWD/${AV}-linux-x86+x64
export PATH=$PWD/Qt${QT}-Linux64/bin:$PATH
export CPATH=$FFMPEG_DIR/include
export LIBRARY_PATH=$FFMPEG_DIR/lib/x64
export LD_LIBRARY_PATH=$FFMPEG_DIR/lib/x64
export QTAV_OUT=QtAV-${TRAVIS_OS_NAME}-${TRAVIS_COMMIT:0:7}
mkdir -p $QTAV_OUT

#if [ "$TRAVIS_BRANCH" == "prelease" ]; then
#linux
21 changes: 21 additions & 0 deletions tools/ci/linux/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
set -ev

echo "$TRAVIS_BUILD_DIR"

tail -n 27 /proc/cpuinfo
uname -a
cat /etc/issue

echo "QtAV build script for travis-ci"

jobs=`cat /proc/cpuinfo |grep 'cpu cores' |wc -l`


cd $QTAV_OUT

rm -f build.log
type -a moc
qmake -r $TRAVIS_BUILD_DIR -spec linux-clang "CONFIG+=recheck"
make -j$jobs 2>&1 |tee build.log

cd $TRAVIS_BUILD_DIR
20 changes: 20 additions & 0 deletions tools/ci/osx/after_success.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cd tools
git clone https://github.com/andreyvit/create-dmg.git

./deploy_osx.sh $QTAV_OUT


PKG=QtAV-QMLPlayer-$TRAVIS_JOB_NUMBER.tar.xz
mv QMLPlayer.dmg $PKG

wget http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz/download -O sshpass.tar.gz
tar zxf sshpass.tar.gz
cd sshpass-1.05
./configure
make
sudo make install
export PATH=$PWD:$PATH
cd $TRAVIS_BUILD_DIR
type -a sshpass
# ignore known hosts: -o StrictHostKeyChecking=no
sshpass -p $SF_PWD scp -o StrictHostKeyChecking=no $PKG $SF_USER@frs.sourceforge.net:/home/frs/project/qtav/ci
14 changes: 14 additions & 0 deletions tools/ci/osx/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FFVER=2.6.2
test -f ffmpeg-${FFVER}-OSX.tar.xz || wget http://sourceforge.net/projects/qtav/files/depends/FFmpeg/OSX/ffmpeg-${FFVER}-OSX.tar.xz/download -O ffmpeg-${FFVER}-OSX.tar.xz
tar Jxf ffmpeg-${FFVER}-OSX.tar.xz

export FFMPEG_DIR=$PWD/ffmpeg-${FFVER}-OSX
export CPATH=$FFMPEG_DIR/include
export LIBRARY_PATH=$FFMPEG_DIR/lib/x64
export LD_LIBRARY_PATH=$FFMPEG_DIR/lib/x64

# TODO: download qt
brew update
brew install qt5

#export QTDIR
21 changes: 21 additions & 0 deletions tools/ci/osx/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
set -ev

echo "$TRAVIS_BUILD_DIR"

tail -n 27 /proc/cpuinfo
uname -a
cat /etc/issue

echo "QtAV build script for travis-ci"

jobs=`sysctl -n hw.ncpu`


cd $QTAV_OUT

rm -f build.log
type -a moc
qmake -r $TRAVIS_BUILD_DIR -spec linux-clang "CONFIG+=recheck"
make -j$jobs 2>&1 |tee build.log

cd $TRAVIS_BUILD_DIR
2 changes: 2 additions & 0 deletions tools/ci/travis_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# - sudo add-apt-repository ppa:wsnipex/vaapi
set -ev

echo "$TRAVIS_BUILD_DIR"

tail -n 27 /proc/cpuinfo
uname -a
cat /etc/issue
Expand Down
2 changes: 1 addition & 1 deletion tools/deploy_osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Plugins = PlugIns
Qml2Imports = Resources/qml
EOF
cd -
test -f ./yoursway-create-dmg/create-dmg && ./yoursway-create-dmg/create-dmg --window-size 500 300 --icon-size 96 --volname "QtAV $APP" --app-drop-link 240 200 QtAV-$APP.dmg $BUILD_DIR/bin/${APP}.app &
test -f ./create-dmg/create-dmg && ./create-dmg/create-dmg --window-size 500 300 --icon-size 96 --volname "QtAV $APP" --app-drop-link 240 200 QtAV-$APP.dmg $BUILD_DIR/bin/${APP}.app &
}

deploy player
Expand Down

0 comments on commit 6101549

Please sign in to comment.