-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (74 loc) · 2.33 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI
on: [push]
defaults:
run:
shell: bash -el {0}
jobs:
pre-commit-checks:
name: "Pre-commit checks"
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/[email protected]
with:
environments: default lint
- name: pre-commit
run: pixi run pre-commit-run --color=always --show-diff-on-failure
unit-tests:
name: "Unit tests"
runs-on: ubuntu-latest
env:
CI: True
strategy:
fail-fast: true
matrix:
env: ["py39", "py310", "py311", "py312", "py313"]
os: ['ubuntu-latest', 'windows-latest']
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/[email protected]
with:
environments: ${{ matrix.env }}
- name: Run unit tests
run: |
pixi run -e ${{ matrix.env }} postinstall
pixi run -e ${{ matrix.env }} pytest test/unit
linux-integration_tests-sqlserver:
name: "Integration tests"
runs-on: ubuntu-latest
env:
CI: True
strategy:
fail-fast: false
matrix:
env: ["py39", "py310", "py311", "py312", "py313"]
services:
DB:
image: mcr.microsoft.com/mssql/server:2019-latest
env:
ACCEPT_EULA: Y
SA_PASSWORD: pytsql-Test-123
ports:
- 1433:1433
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/[email protected]
with:
environments: ${{ matrix.env }}
- name: Install msodbcsql17 driver
run: |
wget https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/m/msodbcsql17/msodbcsql17_17.10.1.1-1_amd64.deb
ACCEPT_EULA=Y sudo apt install ./msodbcsql17_17.10.1.1-1_amd64.deb --allow-downgrades
- name: Wait for SQL Server
timeout-minutes: 1
run: until docker logs "${{ job.services.db.id }}" 2>&1 | grep -q "SQL Server is now ready"; do sleep 10; done
- name: Run integration tests
run: |
pixi run -e ${{ matrix.env }} postinstall
pixi run -e ${{ matrix.env }} pytest --backend=mssql tests/integration