Skip to content

Commit

Permalink
Run test scenes when building master
Browse files Browse the repository at this point in the history
The wiki explaining how it works is available [here](https://github.com/appleseedhq/appleseed/wiki/Custom-continuous-integration).

Test report is available [here](http://107.170.222.178:8181/).

Another Travis job in Ship mode was added to the jobs list. We should consider removing some jobs to use less computer power.

The process to run the test scenes is the following:
1. Wait for the Ship build job to be done
2. Send the build to a custom server
3. Ask the custom server to run test scenes script
  • Loading branch information
oktomus authored Apr 14, 2020
1 parent a77da26 commit 97b953f
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 13 deletions.
24 changes: 19 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,46 @@ addons:
- python2.7-dev
- qtbase5-dev
- libqt5opengl5-dev
- sshpass

install:
- if [ -n "$GCC_VERSION" ]; then export CC="${CC}-${GCC_VERSION}"; fi
- if [ -n "$GCC_VERSION" ]; then export CXX="${CXX}-${GCC_VERSION}"; fi
- if [ -n "$CLANG_VERSION" ]; then export CC="clang-${CLANG_VERSION}"; fi
- if [ -n "$CLANG_VERSION" ]; then export CXX="clang++-${CLANG_VERSION}"; fi

matrix:
jobs:
fast_finish: true

include:
- os: linux
compiler: gcc
env: GCC_VERSION=6
env: GCC_VERSION=6 BUILD_TYPE=Debug

- os: linux
compiler: gcc
env: GCC_VERSION=7
env: GCC_VERSION=6 BUILD_TYPE=Ship DEPLOY_ON_SERVER=true

- os: linux
compiler: gcc
env: GCC_VERSION=7 BUILD_TYPE=Debug

- os: linux
compiler: clang
env: CLANG_VERSION=8
env: CLANG_VERSION=8 BUILD_TYPE=Debug

- os: osx
compiler: clang
compiler: clang
env: BUILD_TYPE=Debug

script:
- if [ $TRAVIS_OS_NAME == linux ]; then chmod +x ./scripts/travis/build-linux.sh ; ./scripts/travis/build-linux.sh ; fi
- if [ $TRAVIS_OS_NAME == osx ]; then chmod +x ./scripts/travis/build-macos.sh ; ./scripts/travis/build-macos.sh ; fi

deploy:
provider: script
skip_cleanup: true # if false, build files are deleted before deploy
script: bash ./scripts/travis/deploy-linux-build.sh
on:
branch: master
condition: $DEPLOY_ON_SERVER == true
8 changes: 4 additions & 4 deletions scripts/travis/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export CMAKE_LIBRARY_PATH=$APPLESEED_DEPENDENCIES/lib
#--------------------------------------------------------------------------------------------------

export LD_LIBRARY_PATH=$APPLESEED_DEPENDENCIES/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$PYTHONPATH:sandbox/lib/Debug/python
export PYTHONPATH=$PYTHONPATH:sandbox/lib/$BUILD_TYPE/python


#--------------------------------------------------------------------------------------------------
Expand All @@ -82,7 +82,7 @@ pushd build
# while libSeExprEditor.so from the linux-deps package was built against Qt 5.12.0.
cmake \
-Wno-dev \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" \
-DWITH_EMBREE=ON \
-DUSE_SSE42=ON \
Expand Down Expand Up @@ -126,7 +126,7 @@ echo "travis_fold:end:build"
echo "travis_fold:start:unit-tests"
echo "Running appleseed unit tests..."

sandbox/bin/Debug/appleseed.cli --run-unit-tests --verbose-unit-tests
sandbox/bin/$BUILD_TYPE/appleseed.cli --run-unit-tests --verbose-unit-tests

echo "travis_fold:end:unit-tests"

Expand All @@ -138,7 +138,7 @@ echo "travis_fold:end:unit-tests"
echo "travis_fold:start:python-unit-tests"
echo "Running appleseed.python unit tests..."

python sandbox/lib/Debug/python/appleseed/test/runtests.py
python sandbox/lib/$BUILD_TYPE/python/appleseed/test/runtests.py

echo "travis_fold:end:python-unit-tests"

Expand Down
8 changes: 4 additions & 4 deletions scripts/travis/build-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ echo "travis_fold:end:seexpr"
#--------------------------------------------------------------------------------------------------

export DYLD_LIBRARY_PATH=$THISDIR/lib:$DYLD_LIBRARY_PATH
export PYTHONPATH=$PYTHONPATH:sandbox/lib/Debug/python
export PYTHONPATH=$PYTHONPATH:sandbox/lib/$BUILD_TYPE/python


#--------------------------------------------------------------------------------------------------
Expand All @@ -163,7 +163,7 @@ pushd build

cmake \
-Wno-dev \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_PREFIX_PATH=/usr/local/opt/qt \
-DWITH_DISNEY_MATERIAL=ON \
-DWITH_EMBREE=ON \
Expand Down Expand Up @@ -192,7 +192,7 @@ make -j 2
popd

install_name_tool -change libSeExpr.dylib $THISDIR/lib/libSeExpr.dylib build/src/appleseed/libappleseed.dylib
install_name_tool -change libSeExpr.dylib $THISDIR/lib/libSeExpr.dylib sandbox/lib/Debug/python/appleseed/_appleseedpython.so
install_name_tool -change libSeExpr.dylib $THISDIR/lib/libSeExpr.dylib sandbox/lib/$BUILD_TYPE/python/appleseed/_appleseedpython.so

echo "travis_fold:end:build"

Expand All @@ -204,7 +204,7 @@ echo "travis_fold:end:build"
echo "travis_fold:start:unit-tests"
echo "Running appleseed unit tests..."

sandbox/bin/Debug/appleseed.cli --run-unit-tests --verbose-unit-tests
sandbox/bin/$BUILD_TYPE/appleseed.cli --run-unit-tests --verbose-unit-tests

echo "travis_fold:end:unit-tests"

Expand Down
79 changes: 79 additions & 0 deletions scripts/travis/deploy-linux-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/bin/bash

#
# This source file is part of appleseed.
# Visit https://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2020 Kevin Masson, The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#


set -e

THISDIR=`pwd`


#--------------------------------------------------------------------------------------------------
# Create a report.
#--------------------------------------------------------------------------------------------------

echo "travis_fold:start:report"
echo "Creating a report..."

touch build_report.txt

echo "web url=$TRAVIS_BUILD_WEB_URL" >> build_report.txt
echo "job url=$TRAVIS_JOB_WEB_URL" >> build_report.txt
echo "commit=$TRAVIS_COMMIT" >> build_report.txt
echo "commit message=$TRAVIS_COMMIT_MESSAGE" >> build_report.txt
echo "job id=$TRAVIS_JOB_ID" >> build_report.txt
echo "job name=$TRAVIS_JOB_NAME" >> build_report.txt
echo "job number=$TRAVIS_JOB_NUMBER" >> build_report.txt

echo "travis_fold:end:report"


#--------------------------------------------------------------------------------------------------
# Deploy build.
#--------------------------------------------------------------------------------------------------

echo "travis_fold:start:deploy"
echo "Deploy travis build on the server..."

# Add server public key to known hosts.
echo $DEPLOY_SSH_KEY >> $HOME/.ssh/known_hosts

# Send build to server.
export SSHPASS=$DEPLOY_PASSWORD
sshpass -e rsync \
-raz --stats -no-perms --no-owner --no-group \
--exclude 'src' \
--exclude 'docs' \
--exclude 'cmake' \
./* \
$DEPLOY_USER@$DEPLOY_URL:$DEPLOY_FOLDER

echo "travis_fold:end:deploy"


set +e

0 comments on commit 97b953f

Please sign in to comment.