Remove tests for no longer optional components #993
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test with conda | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '47 6 * * *' | |
# Automatically stop old builds on the same branch/PR | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash -el {0} | |
jobs: | |
# TODO: | |
#linux-release: | |
# runs-on: ubuntu-latest | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# environment: ["py310-pa13"] | |
# steps: | |
# - name: Publish package | |
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && github.repository == 'blue-yonder/turbodbc' | |
# uses: pypa/[email protected] | |
# with: | |
# user: __token__ | |
# password: ${{ secrets.PYPI_UPLOAD }} | |
# packages_dir: result/dist | |
linux-tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
environment: ["py310-pa13"] | |
services: | |
postgres: | |
image: postgres:11 | |
options: "--hostname postgres" | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_PASSWORD: password | |
POSTGRES_USER: postgres | |
POSTGRES_DB: test_db | |
mysql: | |
# test do not run with a newer mysql at the moment | |
image: mysql:5.6 | |
# command: --default-authentication-plugin=mysql_native_password | |
env: | |
MYSQL_ROOT_PASSWORD: StrongPassword1 | |
MYSQL_USER: mysqluser | |
MYSQL_PASSWORD: password | |
MYSQL_DATABASE: test_db | |
ports: | |
- 3306:3306 | |
mssql: | |
image: mcr.microsoft.com/mssql/server:2017-latest | |
env: | |
ACCEPT_EULA: Y | |
SA_PASSWORD: StrongPassword1 | |
ports: | |
- 1433:1433 | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Fetch full git history | |
run: git fetch --prune --unshallow | |
- name: Set up pixi | |
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 | |
with: | |
environments: ${{ matrix.environment }} | |
- name: Build and test | |
shell: pixi run bash -e {0} | |
env: | |
# TURBODBC_TEST_CONFIGURATION_FILES: "tests/query_fixtures_postgresql.json,query_fixtures_mssql.json,query_fixtures_mysql.json" | |
TURBODBC_TEST_CONFIGURATION_FILES: "tests/query_fixtures_postgresql.json" | |
run: | | |
python -m build | |
python -m pip install dist/*.whl | |
ls -l $(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])') | |
python -c 'import turbodbc' | |
export ODBCSYSINI=$(pwd)/odbc_test_linux | |
sed -i "s;CONDA_PREFIX;${CONDA_PREFIX};g" odbc_test_linux/odbcinst.ini | |
pytest | |
macos-tests: | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
environment: ["py310-pa13"] | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Fetch full git history | |
run: git fetch --prune --unshallow | |
- name: Set up pixi | |
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 | |
with: | |
environments: ${{ matrix.environment }} | |
- name: Setup postgres | |
shell: pixi run bash -e {0} | |
run: | | |
initdb -D mylocal_db | |
pg_ctl -D mylocal_db -l logfile start | |
- name: Build and test | |
shell: pixi run bash -e {0} | |
run: | | |
python -m build | |
python -m pip install dist/*.whl | |
ls -l $(python3 -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])') | |
python -c 'import turbodbc' | |
pytest | |
windows-pixi-tests: | |
defaults: | |
run: | |
shell: cmd /C call {0} | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
environment: ["py310-pa13"] | |
steps: | |
- name: Create SQL Server | |
shell: pwsh | |
run: | | |
Write-Host "Downloading" | |
Import-Module BitsTransfer | |
Start-BitsTransfer -Source "https://download.microsoft.com/download/3/8/d/38de7036-2433-4207-8eae-06e247e17b25/SqlLocalDB.msi" -Destination SqlLocalDB.msi | |
Write-Host "Installing" | |
Start-Process -FilePath "SqlLocalDB.msi" -Wait -ArgumentList "/qn", "/norestart", "/l*v SqlLocalDBInstall.log", "IACCEPTSQLLOCALDBLICENSETERMS=YES" | |
sqlcmd -S '(localdb)\MSSQLLocalDB' -Q 'CREATE DATABASE test_db' -l 60 | |
- name: Configure ODBC Data Source | |
run: | | |
odbcconf /a {CONFIGDSN "ODBC Driver 17 for SQL Server" "DSN=MSSQL|Server=(localdb)\MSSQLLocalDB|Database=test_db|Trusted_Connection=Yes"} | |
if %errorlevel% neq 0 exit /b %errorlevel% | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Fetch full git history | |
run: git fetch --prune --unshallow | |
- name: Set up pixi | |
uses: prefix-dev/setup-pixi@ba3bb36eb2066252b2363392b7739741bb777659 | |
with: | |
environments: ${{ matrix.environment }} | |
- name: Build wheel | |
shell: pixi run pwsh -Command {0} | |
run: python -m build | |
- name: Install and test wheel | |
shell: pixi run pwsh -Command {0} | |
run: | | |
python -m pip install dist/*.whl | |
pytest |