@@ -13,24 +13,87 @@ concurrency:
1313 cancel-in-progress : true
1414
1515jobs :
16+ generate-matrix :
17+ runs-on : ubuntu-24.04
18+
19+ outputs :
20+ sessions : ${{ steps.set-matrix.outputs.sessions }}
21+
22+ steps :
23+ - name : Checkout
24+ uses : actions/checkout@v4
25+
26+ - name : " Set up Python"
27+ uses : actions/setup-python@v5
28+ with :
29+ python-version-file : " pyproject.toml"
30+
31+ - name : Install uv
32+ uses : astral-sh/setup-uv@v6
33+
34+ - id : set-matrix
35+ name : Set nox sessions for matrix
36+ run : |
37+ set -euo pipefail
38+ echo "sessions=$(uv run --only-group nox -- tasks/gh-nox-sessions)" >> $GITHUB_OUTPUT
39+ env :
40+ PYTHONPATH : ' ./src'
41+
1642 nox :
17- runs-on : ubuntu-latest
43+ needs : generate-matrix
44+ runs-on : ubuntu-24.04
45+
46+ strategy :
47+ fail-fast : false
48+ matrix :
49+ session : ${{ fromJson(needs.generate-matrix.outputs.sessions) }}
1850
19- # Runs all steps inside this container
20- container :
21- image : ghcr.io/level12/ubuntu-mive:24-3.12
22- options : --user root
51+ services :
52+ postgres :
53+ image : postgres:17
54+ env :
55+ POSTGRES_HOST_AUTH_METHOD : trust
56+ ports :
57+ - 5432:5432
58+ options : >-
59+ --health-cmd="pg_isready -U postgres"
60+ --health-interval=3s
61+ --health-timeout=3s
62+ --health-retries=15
63+
64+ mssql :
65+ image : mcr.microsoft.com/mssql/server:2019-latest
66+ env :
67+ ACCEPT_EULA : Y
68+ SA_PASSWORD : Docker-sa-password
69+ ports :
70+ - 1433:1433
71+ options : >-
72+ --health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P Docker-sa-password -Q \"select 'ok'\""
73+ --health-interval=3s
74+ --health-timeout=3s
75+ --health-retries=15
2376
2477 env :
2578 UV_LINK_MODE : copy
2679
2780 steps :
28- - name : Checkout Code
81+ - name : Checkout
2982 uses : actions/checkout@v4
3083
31- - name : Mark repo as safe for Git
32- run : git config --global --add safe.directory "$GITHUB_WORKSPACE"
84+ - name : " Set up Python"
85+ uses : actions/setup-python@v5
86+ with :
87+ python-version-file : " pyproject.toml"
88+
89+ - name : Install uv
90+ uses : astral-sh/setup-uv@v6
91+
92+ # MSSQL sessions need ODBC driver in the runner
93+ - name : Install MS ODBC driver (Ubuntu)
94+ if : contains(matrix.session, 'pytest_mssql')
95+ run : tasks/odbc-driver-install
3396
34- - name : Run Tests
97+ - name : Run Nox session
3598 run : |
36- uv run --only-group nox -- nox
99+ uv run --only-group nox -- nox -s "${{ matrix.session }}"
0 commit comments