Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Travis #178

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 30 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,50 @@
language: node_js

dist: xenial

sudo: true

node_js:
- "10"
- "8"
- "10"
- "12"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

14 too?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say both 14 and 15.


services:
- mysql

addons:
postgresql: "9.4"
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8

branches:
except:
- /^v\d+\./

script:
- "npm run ci"
# Node 10 requires installing a specific OpenSSL version (build.sh)
# https://github.com/fastify/fastify-postgres/issues/40
before_install:

- mysql -e 'CREATE DATABASE sequelize_test;'
- psql -c 'create database sequelize_test;' -U postgres
- if [[ $(node -v) =~ v[1-9][0-9] ]]; then
source ./ci_scripts/build.sh;
fi

before_script:
- "mysql -e 'create database sequelize_test;'"
- "psql -c 'create database sequelize_test;' -U postgres"
- "export SEQ_MYSQL_USER=root"
- "export SEQ_PG_USER=postgres"
- "export SEQ_PG_PW=postgres"
- "export SEQ_PG_PW="
- 'if [ "$SEQ_VERSION" ]; then npm install sequelize@^$SEQ_VERSION.0.0; fi'
- 'if [ "$SEQ_VERSION" = "2" ]; then npm install mysql@2 pg@4 pg-native@1; fi'
- 'if [ "$SEQ_VERSION" = "3" ]; then npm install mysql@2 pg@4 pg-native@1; fi'

script:
- "npm run ci"

env:
global:
- CXX=g++-4.8
Expand Down Expand Up @@ -49,13 +73,3 @@ matrix:
env: DB=mysql DIALECT=mysql COVERAGE=true
allow_failures:
- env: DB=mysql DIALECT=mysql COVERAGE=true

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
postgresql: "9.3"

sudo: false
9 changes: 9 additions & 0 deletions ci_scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

BUILD_DIR="$(pwd)"
source ./ci_scripts/install_openssl.sh 1.1.1b
sudo updatedb
source ./ci_scripts/install_libpq.sh
sudo updatedb
sudo ldconfig
cd $BUILD_DIR
38 changes: 38 additions & 0 deletions ci_scripts/install_libpq.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

set -e

OPENSSL_DIR="$(pwd)/openssl-1.1.1b"
POSTGRES_VERSION="11.3"
POSTGRES_DIR="$(pwd)/postgres-${POSTGRES_VERSION}"
TMP_DIR="/tmp/postgres"
JOBS="-j$(nproc || echo 1)"

if [ -d "${TMP_DIR}" ]; then
rm -rf "${TMP_DIR}"
fi

mkdir -p "${TMP_DIR}"

curl https://ftp.postgresql.org/pub/source/v${POSTGRES_VERSION}/postgresql-${POSTGRES_VERSION}.tar.gz | \
tar -C "${TMP_DIR}" -xzf -

cd "${TMP_DIR}/postgresql-${POSTGRES_VERSION}"

if [ -d "${POSTGRES_DIR}" ]; then
rm -rf "${POSTGRES_DIR}"
fi
mkdir -p $POSTGRES_DIR

./configure --prefix=$POSTGRES_DIR --with-openssl --with-includes=${OPENSSL_DIR}/include --with-libraries=${OPENSSL_DIR}/lib --without-readline

cd src/interfaces/libpq; make; make install; cd -
cd src/bin/pg_config; make install; cd -
cd src/backend; make generated-headers; cd -
cd src/include; make install; cd -

export PATH="${POSTGRES_DIR}/bin:${PATH}"
export CFLAGS="-I${POSTGRES_DIR}/include"
export LDFLAGS="-L${POSTGRES_DIR}/lib"
export LD_LIBRARY_PATH="${POSTGRES_DIR}/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="${POSTGRES_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"
35 changes: 35 additions & 0 deletions ci_scripts/install_openssl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh

if [ ${#} -lt 1 ]; then
echo "OpenSSL version required." 1>&2
exit 1
fi

OPENSSL_VERSION="${1}"
OPENSSL_DIR="$(pwd)/openssl-${OPENSSL_VERSION}"
TMP_DIR="/tmp/openssl"
JOBS="-j$(nproc)"

if [ -d "${TMP_DIR}" ]; then
rm -rf "${TMP_DIR}"
fi
mkdir -p "${TMP_DIR}"
curl -s https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz | \
tar -C "${TMP_DIR}" -xzf -
pushd "${TMP_DIR}/openssl-${OPENSSL_VERSION}"
if [ -d "${OPENSSL_DIR}" ]; then
rm -rf "${OPENSSL_DIR}"
fi
./Configure \
--prefix=${OPENSSL_DIR} \
enable-crypto-mdebug enable-crypto-mdebug-backtrace \
linux-x86_64
make -s $JOBS
make install_sw
popd

export PATH="${OPENSSL_DIR}/bin:${PATH}"
export CFLAGS="-I${OPENSSL_DIR}/include"
export LDFLAGS="-L${OPENSSL_DIR}/lib"
export LD_LIBRARY_PATH="${OPENSSL_DIR}/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="${OPENSSL_DIR}/lib/pkgconfig:$PKG_CONFIG_PATH"