Commit Graph

73 Commits

Author SHA1 Message Date
Vadim Zeitlin 4c8a7e752b Use platform-appropriate way of getting CPUs number
This is simpler than parsing /sys/devices/system/cpu/online ourselves
and also works under macOS.

Reduce the number of jobs, 1.5*CPU number is too much, so use more
conservative +1 instead.

Also rename TCI_NUMTHREADS (which was another reference to Travis CI) to
just num_cpus.
2021-07-10 11:49:07 +02:00
Vadim Zeitlin 7e52b708ca Don't hardcode 3.4 Python version in the CI build script
Use python3-venv package which should work on all Ubuntu versions,
including Xenial where this script currently runs, and which doesn't
have python3.4-venv.
2021-04-07 21:30:15 +02:00
Vadim Zeitlin 721bb1aa9d Remove trailing whitespace from all files
No real changes.
2021-04-07 19:32:41 +02:00
Vadim Zeitlin 4b3effc19f Try updating Firebird password file again if we failed once
This might help with sporadic failures in Travis CI Firebird build,
which sometimes fails with weird errors like this:

	Unable to complete network request to host "localhost".
	Failed to establish a connection.
	unable to open database
	Error setting new SYSDBA password

Note that dpkg-reconfigure does not return an error in this case, so we
need to check the password file itself to see if it was updated.
2021-04-07 03:57:02 +02:00
Vadim Zeitlin f481d472d3 Replace using PostgreSQL docker container with native server
"services" can't be used with macOS runners and there is no way to limit
them to Linux runners only (i.e. "if:" is not supported here), so we'd
have to use 2 different jobs and duplicate all the other steps if we
wanted to continue using them.

Instead, just install PostgreSQL manually under Linux. This also means
that it isn't done for the builds that don't need it uselessly any more.
2021-03-19 19:17:21 +01:00
Vadim Zeitlin 01b2ebdce3 Launch PostgreSQL database ourselves under macOS
It is installed there but not started by default, so just launch it
ourselves.

Note that we must not use PGHOST etc variables under Mac, as the server
seems to be configured to only listen on the local socket by default, so
don't define them globally and do it only for Linux manually instead.
2021-03-19 19:16:39 +01:00
Vadim Zeitlin 307addcd0b Use C++11 by default for empty backend build
Don't require CMAKE_CXX_STANDARD to be defined, just use a reasonable
default if it isn't.
2021-03-19 14:21:57 +01:00
Vadim Zeitlin 48c0cd4e9c Rename before_install_*.sh to just install_*.sh
It doesn't make sense to call these scripts "before install" because
they do actually install things themselves.

In fact the whole separation into "install" and "before build" is
probably not very useful, but keep it as long as we keep using Travis CI
at all, as it maps better to its config file keys.

No real changes.
2021-03-19 03:02:41 +01:00
Vadim Zeitlin cbe69e5e13 Use teletype debconf frontend for Firebird setup
"readline" frontend doesn't work without a controlling TTY as can be
seen by setting DEBCONF_DEBUG=user before running dpkg-reconfigure, so
use "teletype" instead.

Also note that DEBIAN_FRONTEND environment variable unexpectedly seems
to override the value explicitly passed via dpkg-reconfigure -f option,
so we need to reset it (and then we don't need the -f option at all).
2021-03-19 02:49:54 +01:00
Vadim Zeitlin 6714c8ff44 Update Firebird install script to work with later Ubuntu version
Handle Xenial which is similar to Trusty and also Focal, where we need
to install Firebird 3.0 server and tweak expect command to work with it.

Note that we still use Xenial for GitHub Actions Firebird CI build as
using Focal version results in memory leaks inside Firebird libraries
and there doesn't seem to be a debug symbol package for Firebird 3.0
that would be required to write a suppression file for them.
2021-03-19 02:49:54 +01:00
Vadim Zeitlin c36eb18dc3 Switch to using Oracle 11g Docker container
This should be simpler than installing it every time and seems to work
more reliably in local testing.
2021-03-19 02:49:54 +01:00
Vadim Zeitlin 56f91e3a2d Verify that connecting to PostgreSQL via ODBC works
Use isql to check it before running the tests.
2021-03-19 01:23:19 +01:00
Vadim Zeitlin 625d970a7c Use full paths to PostgreSQL ODBC driver in odbcinst.ini
This fixes the problem with psqlodbca.so not being found by unixODBC in
GitHub Actions environment.

It remains unclear why was this unnecessary on Travis CI and why it
doesn't work out of the box, but without this change we were always
getting

[unixODBC][Driver Manager]Can't open lib 'psqlodbca.so' : file not found (SQL state 01000)

when trying to connect to the database.
2021-03-19 01:23:19 +01:00
Vadim Zeitlin 9ddda4acf7 Test connection to MySQL database after setting it up
Check that we can connect to the database as the current user.
2021-03-19 00:50:13 +01:00
Vadim Zeitlin 8a0a86e063 Fix using MySQL with GitHub Actions
Start the service explicitly as this is not done by default.

Also explicitly use password with mysql in GitHub Actions environment,
both for the root and for the current user.

This wasn't necessary on Travis CI but is required in this environment,
so specify the root password explicitly and also create the MySQL user
(which is not hardcoded "travis" any longer) and record its password in
~/.my.cnf.
2021-03-19 00:50:13 +01:00
Vadim Zeitlin 9ba098d7db Reuse, rather than duplicate, database creation in valgrind build
Just call the existing scripts instead of copying their contents.
2021-03-19 00:50:13 +01:00
Vadim Zeitlin 33c49a70d5 Remove executable bit from the files not supposed to be executed
These files are only sourced from the other shell scripts, not executed
directly.
2021-03-19 00:50:13 +01:00
Vadim Zeitlin 1ec477a934 Include backend-specific settings from common.sh
This fixes Oracle tests after 325ee4e9 (Split build and test stages of
the CI builds, 2021-03-16) which resulted in oracle.sh not being sourced
when running the tests any longer.
2021-03-19 00:50:13 +01:00
Vadim Zeitlin f602046467 Add GitHub Actions CI workflow
This workflow reuses the same CI scripts as the existing Travis CI
config file and, for now, uses Ubuntu 16.04 (Xenial) runner to be as
close to Travis configuration as possible.
2021-03-19 00:50:13 +01:00
Vadim Zeitlin f9da35df1b Don't install Boost packages unnecessarily
We don't need them when Boost support is explicitly turned off.
2021-03-19 00:50:13 +01:00
Vadim Zeitlin 97dc4df82f Use SOCI_CI_BRANCH instead of TRAVIS_BRANCH
This removes another dependency on Travis CI from the CI scripts.
2021-03-19 00:50:13 +01:00
Vadim Zeitlin 1bb3ed8b3a Use SOCI_CI variable to test for the CI builds
Predefine it for Travis CI builds.
2021-03-19 00:50:13 +01:00
Vadim Zeitlin bce5f9febb Split build and test stages of the CI builds
While this doesn't matter for Travis CI, it makes sense to separate them
for the other CI systems using more structured approach to the build
steps.

Add a few test_*.sh scripts for the backends that need to do something
special when running the tests and just use run_test function for all
the others.
2021-03-19 00:50:05 +01:00
Vadim Zeitlin 2df1438c3b Use generic "CI" term instead of travis-ci.org in script comments
No real changes.
2021-03-16 17:34:14 +01:00
Vadim Zeitlin c13c2e42f2 Rename [before]_script*.sh to [before_]build*.sh
The term "script" is too generic and really doesn't mean anything,
especially outside of Travis CI context, where "script" is used as the
config file key for the build script to run.
2021-03-16 17:34:14 +01:00
Vadim Zeitlin 1133026ce0 Rename SOCI_TRAVIS_BACKEND variable to SOCI_CI_BACKEND
Make another variable name non Travis-specific.
2021-03-16 16:33:37 +01:00
Vadim Zeitlin a2941a5b5e Use SOCI_SOURCE_DIR variable instead of TRAVIS_BUILD_DIR
This variable is not Travis-specific and so could (and will) be reused
for the other CI services. It is also arguably more clear.
2021-03-16 16:31:31 +01:00
Vadim Zeitlin 0a1b55b27c Rename scripts/travis directory to scripts/ci
This will make reusing the scripts there with other CI services less
confusing.

No real changes.
2021-03-16 16:27:00 +01:00
Vadim Zeitlin 422fa050e3 Install debug symbols for libc6 and odbc-postgresql
This should help with more informative stack traces in case of problems
such as ASAN reports.
2020-11-29 15:16:58 +01:00
Vadim Zeitlin 277be5ffb9 Use Xenial version of odbc-postgresql package
Travis hosts use PostgreSQL PPA which is problematic for a few reasons:

1. We don't actually test in the same environment as most SOCI users,
   who would just use the standard Ubuntu repositories and not this PPA.
2. The environment is not even stable, e.g. recently the version of
   psqlodbc has changed from 12 to 13 in Travis builds, breaking them
   due to new leak reports from ASAN.
3. We don't have debug symbols for these packages as the PPA doesn't
   provide them and the ones from Ubuntu repositories don't match. This
   prevents us from even creating precise suppressions for ASAN.

Solve all these problems at once by just sticking to the stock Xenial
version, which doesn't even trigger any leak reports, so there is
nothing to suppress any more and the changes of 457ec97e (Suppress
reports about memory leaks in PostgreSQL ODBC test, 2020-03-29) can be
reverted.
2020-11-29 15:16:58 +01:00
Vadim Zeitlin 072baaf345 Remove hard TAB in a Travis CI script
No real changes.
2020-11-29 15:16:57 +01:00
Vadim Zeitlin ce6f74c906 Only install Valgrind on Travis for the build which needs it
It seems useless to always download and install Valgrind for all builds
when we only need it for a single one of them.
2020-11-29 15:16:57 +01:00
Vadim Zeitlin 372e919a45 Debug expect script used for Firebird configuration
Try to understand why setting the SYSDBA password suddenly doesn't work
any longer.
2020-10-11 00:44:12 +02:00
Vadim Zeitlin 53a1a18ccc Enable -Werror for Travis CI builds too
This needs to be done explicitly now, since the changes of c6ed5f70
(Don't use -Werror unconditionally when building SOCI, 2020-06-05).
2020-10-10 23:36:44 +02:00
Vadim Zeitlin 84fed32d0b Refactor Travis CI build scripts to reuse common options
Define SOCI_DEFAULT_CMAKE_OPTIONS once and use it in almost all builds
instead of repeating the same options many times everywhere.

For the remaining build (Valgrind) still reuse a couple of options which
it has in common with the other ones.
2020-10-10 23:36:40 +02:00
Vadim Zeitlin 457ec97eec Suppress reports about memory leaks in PostgreSQL ODBC test
Unfortunately we don't get any information about these leaks, the entire
report looks like this:

==6706==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 24 byte(s) in 1 object(s) allocated from:

    #0 0x7f6473f80602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x7f646f89ba82  (/usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so+0x1ba82)

Indirect leak of 25 byte(s) in 1 object(s) allocated from:

    #0 0x7f6473f80602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x7f646f89ba9a  (/usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so+0x1ba9a)

SUMMARY: AddressSanitizer: 49 byte(s) leaked in 2 allocation(s).

So we have no choice but to suppress all leaks from psqlodbca.so to let
the tests to pass on Travis CI.
2020-03-29 16:00:18 +02:00
Vadim Zeitlin f032c2a695 Disable even more leaks in DB/2 tests on Travis CI
Unfortunately we don't get any real information about these leaks, the
entire report is

==10667==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 176 byte(s) in 1 object(s) allocated from:
    #0 0x7ff24b649602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x7ff23f0ef551  (<unknown module>)

Indirect leak of 744 byte(s) in 3 object(s) allocated from:
    #0 0x7ff24b649602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x7ff23f0ef551  (<unknown module>)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7ff24b649602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
    #1 0x7ff23f456d89  (<unknown module>)

So we can only disable leaks coming from libasan.so to suppress them
which, of course, risks hiding any other leaks too. The only way to
check for them is to check that the count of suppressions in libasan.so
doesn't increase beyond 5.
2020-03-29 16:00:18 +02:00
Vadim Zeitlin c24601a3a8 Stop running MySQL ODBC tests on Travis CI
MySQL ODBC driver is not available in Ubuntu Xenial 16.04 any longer.
2020-03-29 16:00:18 +02:00
Vadim Zeitlin 96dc0207a1 Suppress DB/2 memory leak report in Travis CI builds
This leak is unavoidable, so just suppress it.
2020-03-29 15:59:44 +02:00
Mateusz Łoskot 6dcfe530f2 release.sh: Add git hash to version in CHANGES 2019-10-25 23:29:10 +02:00
Mateusz Łoskot 23cceccc89 releas.sh: include tests in archie [ci skip] 2019-10-25 22:43:18 +02:00
Mateusz Łoskot 186266a70c Delete release branch checked out for archiving [ci skip] 2019-10-25 22:39:16 +02:00
Mateusz Łoskot 044629c96c [travis] Run release.sh as part of job building empty backend [skip appveyor]
If TRAVIS_BRANCH matches release/X.Y, then the once the Travs CI job
completes building the empty, it also does
- run release.sh to generate source archive for soci-X.Y.Z
- unpacks the archive
- runs a minimal test build of the source archive,
  equivalent to the main build run earlier by the job.

The purpose is to have a minimal procedure verifying the source code
archives generated for release.
2019-10-06 23:01:59 +02:00
Mateusz Łoskot bea818f967 Fix release.sh to abort when Python venv is not ready 2019-10-06 23:01:59 +02:00
Mateusz Łoskot e6ec2b3df2 Make release.sh executable [ci skip] 2019-10-06 21:23:53 +02:00
Mateusz Łoskot b57275399e Fix handling of release candidate number in release.sh [ci skip] 2019-10-06 20:46:55 +02:00
Mateusz Łoskot 24b21d0d9f Update release.sh with handling of RC numbers [ci skip]
Update RELEASING.md guide about tagging.
2019-10-05 18:56:47 +02:00
Mateusz Łoskot 3ef8f87f11 release.sh: Add support for building release candidate packages [ci skip]
Remove automatic branching off of master as release/X.Y,
instead expect and require existing release branch.

Update RELEASING.md about use of the release.sh script.
2019-10-05 12:27:38 +02:00
Mateusz Łoskot 13995eb944 Add scripts/release.sh helper to build release archives [ci skip] 2019-10-04 23:59:54 +02:00
Mateusz Łoskot d581cf49e4 Set CMAKE_CXX_STANDARD with interaction with SOCI_CXX11 (#758)
Add minimal Travis CI job with CMAKE_CXX_STANDARD=11.

Closes #752
2019-10-02 11:13:50 +02:00