Revamp CMake support #691
Workflow file for this run
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
# Continuous integration workflow for SOCI. | |
name: GitHub CI | |
on: | |
push: | |
branches: | |
- master | |
- 'release/**' | |
paths-ignore: | |
- .circleci/** | |
- .cirrus.yml | |
- .github/workflows/codeql.yml | |
- appveyor.yml | |
pull_request: | |
branches: | |
- master | |
paths-ignore: | |
- .circleci/** | |
- .cirrus.yml | |
- .github/workflows/codeql.yml | |
- appveyor.yml | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
lib_type: [shared, static] | |
# Can't test DB2 as required db2exc package is no longer available after Ubuntu 14.04 | |
backend: [sqlite3, postgresql, mysql, firebird, oracle, odbc, empty, valgrind] | |
runner: [ubuntu-22.04] | |
cxxstd: [14] | |
test_release_package: [false] | |
build_examples: [false] | |
include: | |
- backend: empty | |
runner: macos-11 | |
- backend: postgresql | |
runner: macos-11 | |
- backend: sqlite3 | |
runner: macos-11 | |
- backend: oracle | |
no_boost: true | |
runner: ubuntu-22.04 | |
- backend: sqlite3 | |
cxxstd: 17 | |
runner: ubuntu-22.04 | |
- backend: empty | |
test_release_package: true | |
runner: ubuntu-22.04 | |
- backend: empty | |
build_examples: true | |
runner: ubuntu-22.04 | |
runs-on: ${{ matrix.runner }} | |
env: | |
SOCI_CI: true | |
SOCI_CI_BACKEND: ${{ matrix.backend }} | |
SOCI_MYSQL_ROOT_PASSWORD: root | |
ASAN_OPTIONS: fast_unwind_on_malloc=0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set environment variables | |
run: | | |
set_env_var() { | |
echo "Setting environment variable $1=$2" | |
echo $1=$2 >> $GITHUB_ENV | |
} | |
set_env_var SOCI_CI_BRANCH $GITHUB_REF | |
set_env_var SOCI_SOURCE_DIR $GITHUB_WORKSPACE | |
case "${{runner.os}}" in | |
Linux) | |
set_env_var PGHOST localhost | |
set_env_var PGPORT 5432 | |
set_env_var PGUSER postgres | |
set_env_var PGPASSWORD 'Password12!' | |
;; | |
macOS) | |
set_env_var PGDATA /usr/local/var/postgres | |
;; | |
esac | |
if [ -n "${{matrix.cxxstd}}" ]; then | |
set_env_var SOCI_CXXSTD ${{matrix.cxxstd}} | |
fi | |
if [ "${{matrix.no_boost}}" = true ]; then | |
set_env_var WITH_BOOST OFF | |
fi | |
if [ "${{matrix.test_release_package}}" = true ]; then | |
set_env_var TEST_RELEASE_PACKAGE YES | |
fi | |
if [ "${{matrix.build_examples}}" = true ]; then | |
set_env_var BUILD_EXAMPLES YES | |
fi | |
if [ "${{matrix.lib_type}}" = "static" ]; then | |
set_env_var SOCI_BUILD_STATIC YES | |
fi | |
- name: Install dependencies under Linux | |
if: runner.os == 'Linux' | |
run: ./scripts/ci/install.sh | |
- name: Prepare for build | |
run: ./scripts/ci/before_build.sh | |
- name: Build | |
run: ./scripts/ci/build.sh | |
- name: Test | |
run: ./scripts/ci/test.sh |