Skip to content

Test Suite

Test Suite #934

Workflow file for this run

---
name: Test Suite
on:
push:
branches:
- "**"
pull_request:
branches: ["main"]
schedule:
- cron: "0 0 * * *"
jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
services:
mariadb:
image: mariadb:11
env:
MYSQL_USER: username
MYSQL_PASSWORD: passwsss*1348394#
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: testsuite
ports:
- 3306:3306
options: --health-cmd="mariadb-admin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:16
env:
POSTGRES_USER: username
POSTGRES_PASSWORD: passwsss*1348394#
POSTGRES_DB: testsuite
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mssql:
image: mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04
env:
MSSQL_SA_PASSWORD: Mssql123mssql-
ACCEPT_EULA: "Y"
MSSQL_PID: Developer
ports:
- 1433:1433
options: >-
--health-cmd "/opt/mssql-tools/bin/sqlcmd -U sa -P Mssql123mssql- -Q 'select 1' -b -o /dev/null"
--health-interval 60s
--health-timeout 30s
--health-start-period 20s
--health-retries 3
steps:
- uses: "actions/checkout@v4"
- uses: "dorny/paths-filter@v3"
id: filters
with:
filters: |
docs_src:
- 'docs_src/**'
- 'pyproject.toml'
src:
- 'databasez/**'
- 'tests/**'
- 'scripts/**'
- 'docker-compose.yml'
- 'pyproject.toml'
workflows:
- '.github/workflows/**'
- uses: "actions/setup-python@v5"
with:
python-version: "${{ matrix.python-version }}"
allow-prereleases: true
- name: "Install drivers"
run: |
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 default-jre
sudo apt-get install -y unixodbc-dev
- name: Install build dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install hatch
- name: "Run linting"
if: steps.filters.outputs.src == 'true'
run: "hatch fmt --check"
- name: "Run mypy"
if: steps.filters.outputs.src == 'true'
run: "hatch run test:check_types"
- name: "Run tests"
if: steps.filters.outputs.src == 'true' || steps.filters.outputs.workflows == 'true' || github.event.schedule != ''
run: env TEST_NO_RISK_SEGFAULTS=true hatch test