Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
65 changes: 65 additions & 0 deletions eng/pipelines/build-whl-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,25 @@ jobs:
shortPyVer: '313'
# Always use universal2 for macOS
targetArch: 'universal2'

# Python 3.12 (universal2 for both arm64 and x86_64)
py312_universal2:
pythonVersion: '3.12'
shortPyVer: '312'
targetArch: 'universal2'

# Python 3.11 (universal2 for both arm64 and x86_64)
py311_universal2:
pythonVersion: '3.11'
shortPyVer: '311'
targetArch: 'universal2'

# Python 3.10 (universal2 for both arm64 and x86_64)
py310_universal2:
pythonVersion: '3.10'
shortPyVer: '310'
targetArch: 'universal2'

steps:
# Use correct Python version and architecture for the current job
- task: UsePythonVersion@0
Expand Down Expand Up @@ -231,7 +250,53 @@ jobs:
Contents: '*.so'
TargetFolder: '$(Build.ArtifactStagingDirectory)/ddbc-bindings'
displayName: 'Place .so file into artifacts directory'

- script: |
brew update
brew install docker colima

# Start Colima with extra resources
colima start --cpu 4 --memory 8 --disk 50

# Optional: set Docker context (usually automatic)
docker context use colima >/dev/null || true

# Confirm Docker is operational
docker version
docker ps
displayName: 'Install and start Colima-based Docker'

- script: |
# Pull and run SQL Server container
docker pull mcr.microsoft.com/mssql/server:2022-latest
docker run \
--name sqlserver \
-e ACCEPT_EULA=Y \
-e MSSQL_SA_PASSWORD="${DB_PASSWORD}" \
-p 1433:1433 \
-d mcr.microsoft.com/mssql/server:2022-latest

# Starting SQL Server container…
for i in {1..30}; do
docker exec sqlserver \
/opt/mssql-tools18/bin/sqlcmd \
-S localhost \
-U SA \
-P "$DB_PASSWORD" \
-C -Q "SELECT 1" && break
sleep 2
done
displayName: 'Pull & start SQL Server (Docker)'
env:
DB_PASSWORD: $(DB_PASSWORD)

# Run Pytest to ensure the bindings work correctly
- script: |
python -m pytest -v
displayName: 'Run Pytest to validate bindings'
env:
DB_CONNECTION_STRING: 'Driver=ODBC Driver 18 for SQL Server;Server=localhost;Database=master;Uid=SA;Pwd=$(DB_PASSWORD);TrustServerCertificate=yes'

# Build wheel package for universal2
- script: |
python -m pip install --upgrade pip
Expand Down
80 changes: 39 additions & 41 deletions eng/pipelines/pr-validation-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,44 +97,44 @@
brew install cmake
displayName: 'Install CMake'

# - script: |
# brew update
# brew install docker colima

# # Start Colima with extra resources
# colima start --cpu 4 --memory 8 --disk 50

# # Optional: set Docker context (usually automatic)
# docker context use colima >/dev/null || true

# # Confirm Docker is operational
# docker version
# docker ps
# displayName: 'Install and start Colima-based Docker'

# - script: |
# # Pull and run SQL Server container
# docker pull mcr.microsoft.com/mssql/server:2022-latest
# docker run \
# --name sqlserver \
# -e ACCEPT_EULA=Y \
# -e MSSQL_SA_PASSWORD="${DB_PASSWORD}" \
# -p 1433:1433 \
# -d mcr.microsoft.com/mssql/server:2022-latest

# # Starting SQL Server container…
# for i in {1..30}; do
# docker exec sqlserver \
# /opt/mssql-tools18/bin/sqlcmd \
# -S localhost \
# -U SA \
# -P "$DB_PASSWORD" \
# -C -Q "SELECT 1" && break
# sleep 2
# done
# displayName: 'Pull & start SQL Server (Docker)'
# env:
# DB_PASSWORD: $(DB_PASSWORD)
- script: |
brew update
brew install docker colima

# Start Colima with extra resources
colima start --cpu 4 --memory 8 --disk 50

# Optional: set Docker context (usually automatic)
docker context use colima >/dev/null || true

# Confirm Docker is operational
docker version
docker ps
displayName: 'Install and start Colima-based Docker'

- script: |
# Pull and run SQL Server container
docker pull mcr.microsoft.com/mssql/server:2022-latest
docker run \
--name sqlserver \
-e ACCEPT_EULA=Y \
-e MSSQL_SA_PASSWORD="${DB_PASSWORD}" \
-p 1433:1433 \
-d mcr.microsoft.com/mssql/server:2022-latest

# Starting SQL Server container…
for i in {1..30}; do
docker exec sqlserver \
/opt/mssql-tools18/bin/sqlcmd \
-S localhost \
-U SA \
-P "$DB_PASSWORD" \
-C -Q "SELECT 1" && break
sleep 2
done
displayName: 'Pull & start SQL Server (Docker)'
env:
DB_PASSWORD: $(DB_PASSWORD)

- script: |
python -m pip install --upgrade pip
Expand All @@ -151,9 +151,7 @@
python -m pytest -v --junitxml=test-results.xml --cov=. --cov-report=xml --capture=tee-sys --cache-clear
displayName: 'Run pytest with coverage'
env:
# Temporarily Use Azure SQL Database connection string for testing purposes since Docker takes too long to install & start in MacOS
DB_CONNECTION_STRING: $(AZURE_CONNECTION_STRING)
# DB_CONNECTION_STRING: 'Driver=ODBC Driver 18 for SQL Server;Server=localhost;Database=master;Uid=SA;Pwd=$(DB_PASSWORD);TrustServerCertificate=yes'
DB_CONNECTION_STRING: 'Driver=ODBC Driver 18 for SQL Server;Server=localhost;Database=master;Uid=SA;Pwd=$(DB_PASSWORD);TrustServerCertificate=yes'
DB_PASSWORD: $(DB_PASSWORD)

- task: PublishTestResults@2
Expand Down
Loading