2222
2323jobs :
2424 test :
25+ name : Test (${{ matrix.os }}, Python ${{ matrix.python-version }}, ${{ matrix.uv-resolution }}, ${{ matrix.database || 'sqlite' }})
2526 strategy :
2627 matrix :
2728 os : [ ubuntu-latest, windows-latest, macos-latest ]
2829 python-version : [ "3.14" ]
2930 uv-resolution :
3031 - highest
3132 include :
33+ - os : ubuntu-latest
34+ python-version : " 3.14"
35+ database : postgres
36+ database-url :
postgresql+psycopg://sqlmodel:[email protected] :15432/sqlmodel_test 3237 - os : ubuntu-latest
3338 python-version : " 3.10"
3439 uv-resolution : lowest-direct
40+ database : mysql
41+ database-url :
mysql+pymysql://sqlmodel:[email protected] :13306/sqlmodel_test 42+ - os : ubuntu-latest
43+ python-version : " 3.11"
44+ uv-resolution : highest
3545 - os : macos-latest
3646 python-version : " 3.11"
3747 uv-resolution : highest
4151 - os : ubuntu-latest
4252 python-version : " 3.13"
4353 uv-resolution : highest
54+ database : mariadb
55+ database-url :
mariadb+pymysql://sqlmodel:[email protected] :13307/sqlmodel_test 4456 - os : macos-latest
4557 python-version : " 3.13"
4658 uv-resolution : highest
5062 env :
5163 UV_PYTHON : ${{ matrix.python-version }}
5264 UV_RESOLUTION : ${{ matrix.uv-resolution }}
65+ DATABASE : ${{ matrix.database || 'sqlite' }}
66+ DATABASE_URL : ${{ matrix.database-url || 'sqlite://' }}
5367 steps :
5468 - uses : actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
5569 with :
@@ -74,18 +88,27 @@ jobs:
7488 limit-access-to-actor : true
7589 - name : Install Dependencies
7690 run : uv sync --no-dev --group tests
91+ - name : Start Database
92+ if : matrix.database
93+ run : docker compose up --wait --wait-timeout 120 "$DATABASE"
7794 - run : mkdir coverage
7895 - name : Test
7996 run : uv run bash scripts/test.sh
8097 env :
81- COVERAGE_FILE : coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.pydantic-version }}
82- CONTEXT : ${{ runner.os }}-py${{ matrix.python-version }}
98+ COVERAGE_FILE : coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.database || 'sqlite' }}
99+ CONTEXT : ${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.database || 'sqlite' }}
83100 - name : Store coverage files
84101 uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
85102 with :
86- name : coverage-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pydantic-version }}
103+ name : coverage-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.database || 'sqlite' }}
87104 path : coverage
88105 include-hidden-files : true
106+ - name : Show Database Logs
107+ if : ${{ failure() && matrix.database }}
108+ run : docker compose logs --no-color "$DATABASE"
109+ - name : Stop Database
110+ if : ${{ always() && matrix.database }}
111+ run : docker compose down --volumes
89112
90113 coverage-combine :
91114 needs :
0 commit comments