Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split .travis.yml actions into shell scripts
Travis CI recommends to keep all extensive steps in shell scripts and keep .travis.yml minimal. It is easy to syntactically break .yml file.
- Loading branch information
Showing
4 changed files
with
65 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
# Run before_intsall actions for SOCI build at travis-ci.org | ||
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI | ||
# | ||
# Install dependencies | ||
sudo apt-get update -qq | ||
sudo apt-get install -qq \ | ||
libboost-dev libboost-date-time-dev \ | ||
libmyodbc unixodbc-dev odbc-postgresql \ | ||
firebird2.5-super firebird2.5-dev | ||
# | ||
# Configure Firebird | ||
# See: Non-interactive setup for travis-ci.org | ||
# http://tech.groups.yahoo.com/group/firebird-support/message/120883 | ||
#sudo dpkg-reconfigure -f noninteractive firebird2.5-super | ||
sudo sed /ENABLE_FIREBIRD_SERVER=/s/no/yes/ -i /etc/default/firebird2.5 | ||
cat /etc/default/firebird2.5 | grep ENABLE_FIREBIRD_SERVER | ||
sudo service firebird2.5-super start | ||
# | ||
# Configure ODBC | ||
sudo odbcinst -i -d -f /usr/share/libmyodbc/odbcinst.ini | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
# Run before_script actions for SOCI build at travis-ci.org | ||
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI | ||
# | ||
# Create local databases | ||
# MySQL (service provided) | ||
mysql --version | ||
mysql -e 'create database soci_test;' | ||
# PostgreSQL (service provided) | ||
psql --version | ||
psql -c 'create database soci_test;' -U postgres | ||
# Firebird (installed manually, see before_install.sh) | ||
isql-fb -z -q -i /dev/null # --version | ||
echo 'CREATE DATABASE "LOCALHOST:/tmp/soci_test.fdb" PAGE_SIZE = 16384;' > /tmp/create_soci_test.sql | ||
isql-fb -u SYSDBA -p masterkey -i /tmp/create_soci_test.sql -q | ||
cat /tmp/create_soci_test.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
# Run script actions for SOCI build at travis-ci.org | ||
# Mateusz Loskot <mateusz@loskot.net>, http://github.com/SOCI | ||
# | ||
# Build SOCI using CMake (primary build configuration) | ||
mkdir -p src/_build | ||
cd src/_build | ||
cmake \ | ||
-DSOCI_TESTS=ON \ | ||
-DSOCI_EMPTY_TEST_CONNSTR:STRING="dummy connection" \ | ||
-DSOCI_FIREBIRD_TEST_CONNSTR:STRING="service=LOCALHOST:/tmp/soci_test.fdb user=SYSDBA password=masterkey" \ | ||
-DSOCI_MYSQL_TEST_CONNSTR:STRING="db=soci_test" \ | ||
-DSOCI_POSTGRESQL_TEST_CONNSTR:STRING="dbname=soci_test user=postgres" \ | ||
-DSOCI_SQLITE3_TEST_CONNSTR:STRING="soci_test.db" \ | ||
-DSOCI_ODBC_TEST_POSTGRESQL_CONNSTR="FILEDSN=${PWD}/../backends/odbc/test/test-postgresql.dsn;" \ | ||
-DSOCI_ODBC_TEST_MYSQL_CONNSTR="FILEDSN=${PWD}/../backends/odbc/test/test-mysql.dsn;" \ | ||
.. | ||
cmake --build . | ||
# Run tests | ||
ctest -V --output-on-failure . |