Skip to content

Commit 4f56e97

Browse files
committed
Changes
1 parent 12fe42e commit 4f56e97

File tree

4 files changed

+455
-77
lines changed

4 files changed

+455
-77
lines changed

.github/workflows/ubuntu_build.yml

Lines changed: 1 addition & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
15+
python-version: ["3.12"]
1616

1717
services:
1818

@@ -40,23 +40,9 @@ jobs:
4040
ACCEPT_EULA: Y
4141
SA_PASSWORD: StrongPassword2022
4242

43-
postgres:
44-
image: postgres:13
45-
env:
46-
POSTGRES_DB: postgres_db
47-
POSTGRES_USER: postgres_user
48-
POSTGRES_PASSWORD: postgres_pwd
49-
ports:
50-
- 5432:5432
51-
# needed because the postgres container does not provide a healthcheck
52-
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
5343

5444
steps:
5545

56-
- name: Start MySQL service
57-
run: |
58-
sudo systemctl start mysql.service
59-
6046
- name: Check initial setup
6147
run: |
6248
echo '*** echo $PATH'
@@ -77,36 +63,6 @@ jobs:
7763
echo '*** ls -l /usr/lib/x86_64-linux-gnu/odbc'
7864
ls -l /opt/microsoft/msodbcsql18/lib64 || true
7965
80-
- name: Install ODBC driver for PostgreSQL
81-
run: |
82-
echo "*** apt-get install the driver"
83-
sudo apt-get install --yes odbc-postgresql
84-
echo '*** ls -l /usr/lib/x86_64-linux-gnu/odbc'
85-
ls -l /usr/lib/x86_64-linux-gnu/odbc || true
86-
echo '*** add full paths to Postgres .so files in /etc/odbcinst.ini'
87-
sudo sed -i 's|Driver=psqlodbca.so|Driver=/usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so|g' /etc/odbcinst.ini
88-
sudo sed -i 's|Driver=psqlodbcw.so|Driver=/usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so|g' /etc/odbcinst.ini
89-
sudo sed -i 's|Setup=libodbcpsqlS.so|Setup=/usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so|g' /etc/odbcinst.ini
90-
91-
- name: Install ODBC driver for MySQL
92-
run: |
93-
cd "$RUNNER_TEMP"
94-
echo "*** download driver zip file"
95-
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"
96-
ls -l "${MYSQL_DRIVER}.tar.gz"
97-
tar -xz -f "${MYSQL_DRIVER}.tar.gz"
98-
echo "*** copy driver file to /usr/lib"
99-
sudo cp -v "${MYSQL_DRIVER}/lib/libmyodbc8a.so" /usr/lib/x86_64-linux-gnu/odbc/
100-
sudo chmod a+r /usr/lib/x86_64-linux-gnu/odbc/libmyodbc8a.so
101-
echo "*** create odbcinst.ini entry"
102-
echo '[MySQL ODBC 8.0 ANSI Driver]' > mysql_odbcinst.ini
103-
echo 'Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc8a.so' >> mysql_odbcinst.ini
104-
echo 'UsageCount = 1' >> mysql_odbcinst.ini
105-
echo 'Threading = 2' >> mysql_odbcinst.ini
106-
sudo odbcinst -i -d -f mysql_odbcinst.ini
107-
env:
108-
CURL_OUTPUT_FORMAT: '%{http_code} %{filename_effective} %{size_download} %{time_total}\n'
109-
MYSQL_DRIVER: mysql-connector-odbc-8.0.22-linux-glibc2.12-x86-64bit
11066
11167
- name: Check ODBC setup
11268
run: |
@@ -135,27 +91,7 @@ jobs:
13591
docker exec -i "${{ job.services.mssql2022.id }}" /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'StrongPassword2022' -C -Q "SELECT @@VERSION" || sleep 5
13692
docker exec -i "${{ job.services.mssql2022.id }}" /opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'StrongPassword2022' -C -Q "CREATE DATABASE test"
13793
138-
- name: Create test database in PostgreSQL
139-
run: |
140-
echo "*** get version"
141-
psql -c "SELECT version()"
142-
echo "*** create database"
143-
psql -c "CREATE DATABASE test WITH encoding='UTF8' LC_COLLATE='en_US.utf8' LC_CTYPE='en_US.utf8'"
144-
echo "*** list databases"
145-
psql -l
146-
env:
147-
PGHOST: localhost
148-
PGPORT: 5432
149-
PGDATABASE: postgres_db
150-
PGUSER: postgres_user
151-
PGPASSWORD: postgres_pwd
15294
153-
- name: Create test database in MySQL
154-
run: |
155-
echo "*** get status"
156-
mysql --user=root --password=root --execute "STATUS"
157-
echo "*** create database"
158-
mysql --user=root --password=root --execute "CREATE DATABASE test"
15995
16096
- uses: actions/checkout@v4.1.1
16197

@@ -186,19 +122,7 @@ jobs:
186122
echo "*** pyodbc drivers"
187123
python -c "import pyodbc; print('\n'.join(sorted(pyodbc.drivers())))"
188124
189-
- name: Run PostgreSQL tests
190-
env:
191-
PYODBC_POSTGRESQL: "DRIVER={PostgreSQL Unicode};SERVER=localhost;PORT=5432;UID=postgres_user;PWD=postgres_pwd;DATABASE=test"
192-
run: |
193-
cd "$GITHUB_WORKSPACE"
194-
python -m pytest "./tests/postgresql_test.py"
195125
196-
- name: Run MySQL tests
197-
env:
198-
PYODBC_MYSQL: "DRIVER={MySQL ODBC 8.0 ANSI Driver};SERVER=localhost;UID=root;PWD=root;DATABASE=test;CHARSET=utf8mb4"
199-
run: |
200-
cd "$GITHUB_WORKSPACE"
201-
python -m pytest "./tests/mysql_test.py"
202126
203127
- name: Run SQL Server 2017 tests
204128
env:

0 commit comments

Comments
 (0)