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 @@ -11,7 +11,7 @@
#
name: "CodeQL"

on: [push, pull_request]
on: [workflow_dispatch]

jobs:
analyze:
Expand Down
118 changes: 59 additions & 59 deletions .github/workflows/ubuntu_build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Ubuntu build

# include "workflow_dispatch" so this workflow can be run manually from the Actions portal
on: [push, pull_request, workflow_dispatch]
on: [pull_request, workflow_dispatch]

jobs:
run_tests:
Expand All @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
python-version: ["3.13"]

services:

Expand Down Expand Up @@ -40,26 +40,26 @@ jobs:
ACCEPT_EULA: Y
SA_PASSWORD: StrongPassword2025

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
# 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:

# to ensure the drivers are installed correctly with apt-get
- name: apt-get update
run: sudo apt-get update

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

- name: Check initial setup
run: |
Expand Down Expand Up @@ -144,28 +144,28 @@ jobs:
echo "*** SQL Server 2025"
docker exec -i "${{ job.services.mssql2025.id }}" /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'StrongPassword2025' -C -Q "SELECT @@VERSION" || sleep 5
docker exec -i "${{ job.services.mssql2025.id }}" /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'StrongPassword2025' -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"
#
# - 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.3.0

Expand Down Expand Up @@ -197,43 +197,43 @@ jobs:
python -c "import pyodbc; print(pyodbc.version)"
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 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 2019 tests
env:
PYODBC_SQLSERVER: "DRIVER={ODBC Driver 18 for SQL Server};SERVER=localhost,1402;UID=sa;PWD=StrongPassword2019;DATABASE=test;Encrypt=Optional"
run: |
cd "$GITHUB_WORKSPACE"
python -m pytest "./tests/sqlserver_test.py"
python -m pytest -s "./tests/sqlserver_test.py"

- name: Run SQL Server 2022 tests
env:
PYODBC_SQLSERVER: "DRIVER={ODBC Driver 18 for SQL Server};SERVER=localhost,1403;UID=sa;PWD=StrongPassword2022;DATABASE=test;Encrypt=Optional"
run: |
cd "$GITHUB_WORKSPACE"
python -m pytest "./tests/sqlserver_test.py"
python -m pytest -s "./tests/sqlserver_test.py"

- name: Run SQL Server 2025 tests
env:
PYODBC_SQLSERVER: "DRIVER={ODBC Driver 18 for SQL Server};SERVER=localhost,1404;UID=sa;PWD=StrongPassword2025;DATABASE=test;Encrypt=Optional"
run: |
cd "$GITHUB_WORKSPACE"
python -m pytest "./tests/sqlserver_test.py"

- name: Run SQLite tests
run: |
cd "$GITHUB_WORKSPACE"
python -m pytest "./tests/sqlite_test.py"
python -m pytest -s "./tests/sqlserver_test.py"
#
# - name: Run SQLite tests
# run: |
# cd "$GITHUB_WORKSPACE"
# python -m pytest "./tests/sqlite_test.py"
Loading
Loading