-
Notifications
You must be signed in to change notification settings - Fork 86
82 lines (81 loc) · 3.77 KB
/
odbc-framework.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: ODBC Tests
on: [push, pull_request]
jobs:
odbc:
name: ODBC
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Clone, build, and run tests for Postgres engine
run: |
cd ..
git clone --branch BABEL_1_1_STABLE__PG_13_5 https://github.com/babelfish-for-postgresql/postgresql_modified_for_babelfish.git
sudo apt-get update
sudo apt-get install uuid-dev openjdk-8-jre libicu-dev libxml2-dev openssl libssl-dev python-dev libossp-uuid-dev libpq-dev cmake pkg-config g++ build-essential bison
cd postgresql_modified_for_babelfish
./configure --prefix=$HOME/postgres/ --with-python PYTHON=/usr/bin/python2.7 --enable-debug CFLAGS="-ggdb" --with-libxml --with-uuid=ossp --with-icu
make -j 4 2>error.txt
make install
cd contrib && make && sudo make install
- name: Copy ANTLR jar file
run: |
cd contrib/babelfishpg_tsql/antlr/thirdparty/antlr/
sudo cp antlr-4.9.3-complete.jar /usr/local/lib
- name: Compile ANTLR
run: |
cd ..
wget http://www.antlr.org/download/antlr4-cpp-runtime-4.9.3-source.zip
unzip -d antlr4 antlr4-cpp-runtime-4.9.3-source.zip
cd antlr4
sed -i "s/git:/https:/g" runtime/CMakeLists.txt
mkdir build && cd build
cmake .. -D ANTLR_JAR_LOCATION=/usr/local/lib/antlr-4.9.3-complete.jar -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_DEMO=True
make
sudo make install
cp /usr/local/lib/libantlr4-runtime.so.4.9.3 ~/postgres/lib/
- name: Set env variables and build extensions
run: |
export PG_CONFIG=~/postgres/bin/pg_config
export PG_SRC=~/work/babelfish_extensions/postgresql_modified_for_babelfish
export cmake=$(which cmake)
cd contrib/babelfishpg_money
make && make install
cd ../babelfishpg_common
make && make install
cd ../babelfishpg_tds
make && make install
cd ../babelfishpg_tsql
make && make install
- name: Install extensions
run: |
cd ~
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
sudo apt-get install mssql-tools unixodbc-dev
export PATH=/opt/mssql-tools/bin:$PATH
~/postgres/bin/initdb -D ~/postgres/data/
~/postgres/bin/pg_ctl -D ~/postgres/data/ -l logfile start
cd postgres/data
sudo sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" postgresql.conf
sudo sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = 'babelfishpg_tds'/g" postgresql.conf
ipaddress=$(ifconfig eth0 | grep 'inet ' | cut -d: -f2 | awk '{ print $2}')
sudo echo "host all all $ipaddress/32 trust" >> pg_hba.conf
~/postgres/bin/pg_ctl -D ~/postgres/data/ -l logfile restart
cd ~/work/babelfish_extensions/babelfish_extensions/
sudo ~/postgres/bin/psql -d postgres -U runner -v user="odbc_user" -v db="odbc_testdb" -f .github/scripts/create_extension.sql
sqlcmd -S localhost -U odbc_user -P 12345678 -Q "SELECT @@version GO"
- name: Install ODBC driver
run: |
cd ~
sudo apt-get install msodbcsql17
- name: Run ODBC tests
run: |
cd test/odbc
cmake -S . -B build
cmake --build build
BABEL_DB_SERVER=localhost \
BABEL_DB_PORT=1433 \
BABEL_DB_USER=odbc_user \
BABEL_DB_PASSWORD=12345678 \
BABEL_DB_NAME=master \
./build/main