Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'python' ]
language: [ 'cpp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

Expand Down
78 changes: 1 addition & 77 deletions .github/workflows/ubuntu_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.12"]

services:

Expand Down Expand Up @@ -40,23 +40,9 @@ jobs:
ACCEPT_EULA: Y
SA_PASSWORD: StrongPassword2022

postgres:
image: postgres:13
env:
POSTGRES_DB: postgres_db
POSTGRES_USER: postgres_user
POSTGRES_PASSWORD: postgres_pwd
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:

- name: Start MySQL service
run: |
sudo systemctl start mysql.service

- name: Check initial setup
run: |
echo '*** echo $PATH'
Expand All @@ -77,36 +63,6 @@ jobs:
echo '*** ls -l /usr/lib/x86_64-linux-gnu/odbc'
ls -l /opt/microsoft/msodbcsql18/lib64 || true

- name: Install ODBC driver for PostgreSQL
run: |
echo "*** apt-get install the driver"
sudo apt-get install --yes odbc-postgresql
echo '*** ls -l /usr/lib/x86_64-linux-gnu/odbc'
ls -l /usr/lib/x86_64-linux-gnu/odbc || true
echo '*** add full paths to Postgres .so files in /etc/odbcinst.ini'
sudo sed -i 's|Driver=psqlodbca.so|Driver=/usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so|g' /etc/odbcinst.ini
sudo sed -i 's|Driver=psqlodbcw.so|Driver=/usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so|g' /etc/odbcinst.ini
sudo sed -i 's|Setup=libodbcpsqlS.so|Setup=/usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so|g' /etc/odbcinst.ini

- name: Install ODBC driver for MySQL
run: |
cd "$RUNNER_TEMP"
echo "*** download driver zip file"
curl --silent --show-error --write-out "$CURL_OUTPUT_FORMAT" -O "https://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/Connector-ODBC/8.0/${MYSQL_DRIVER}.tar.gz"
ls -l "${MYSQL_DRIVER}.tar.gz"
tar -xz -f "${MYSQL_DRIVER}.tar.gz"
echo "*** copy driver file to /usr/lib"
sudo cp -v "${MYSQL_DRIVER}/lib/libmyodbc8a.so" /usr/lib/x86_64-linux-gnu/odbc/
sudo chmod a+r /usr/lib/x86_64-linux-gnu/odbc/libmyodbc8a.so
echo "*** create odbcinst.ini entry"
echo '[MySQL ODBC 8.0 ANSI Driver]' > mysql_odbcinst.ini
echo 'Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc8a.so' >> mysql_odbcinst.ini
echo 'UsageCount = 1' >> mysql_odbcinst.ini
echo 'Threading = 2' >> mysql_odbcinst.ini
sudo odbcinst -i -d -f mysql_odbcinst.ini
env:
CURL_OUTPUT_FORMAT: '%{http_code} %{filename_effective} %{size_download} %{time_total}\n'
MYSQL_DRIVER: mysql-connector-odbc-8.0.22-linux-glibc2.12-x86-64bit

- name: Check ODBC setup
run: |
Expand Down Expand Up @@ -135,27 +91,7 @@ jobs:
docker exec -i "${{ job.services.mssql2022.id }}" /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'StrongPassword2022' -C -Q "SELECT @@VERSION" || sleep 5
docker exec -i "${{ job.services.mssql2022.id }}" /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'StrongPassword2022' -C -Q "CREATE DATABASE test"

- name: Create test database in PostgreSQL
run: |
echo "*** get version"
psql -c "SELECT version()"
echo "*** create database"
psql -c "CREATE DATABASE test WITH encoding='UTF8' LC_COLLATE='en_US.utf8' LC_CTYPE='en_US.utf8'"
echo "*** list databases"
psql -l
env:
PGHOST: localhost
PGPORT: 5432
PGDATABASE: postgres_db
PGUSER: postgres_user
PGPASSWORD: postgres_pwd

- name: Create test database in MySQL
run: |
echo "*** get status"
mysql --user=root --password=root --execute "STATUS"
echo "*** create database"
mysql --user=root --password=root --execute "CREATE DATABASE test"

- uses: actions/checkout@v4.1.1

Expand Down Expand Up @@ -186,19 +122,7 @@ jobs:
echo "*** pyodbc drivers"
python -c "import pyodbc; print('\n'.join(sorted(pyodbc.drivers())))"

- name: Run PostgreSQL tests
env:
PYODBC_POSTGRESQL: "DRIVER={PostgreSQL Unicode};SERVER=localhost;PORT=5432;UID=postgres_user;PWD=postgres_pwd;DATABASE=test"
run: |
cd "$GITHUB_WORKSPACE"
python -m pytest "./tests/postgresql_test.py"

- name: Run MySQL tests
env:
PYODBC_MYSQL: "DRIVER={MySQL ODBC 8.0 ANSI Driver};SERVER=localhost;UID=root;PWD=root;DATABASE=test;CHARSET=utf8mb4"
run: |
cd "$GITHUB_WORKSPACE"
python -m pytest "./tests/mysql_test.py"

- name: Run SQL Server 2017 tests
env:
Expand Down
Loading
Loading