-
Notifications
You must be signed in to change notification settings - Fork 3
95 lines (90 loc) · 3.04 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: CI
on: [push]
jobs:
pre-commit-checks:
name: "Linux - pre-commit checks - Python 3.8"
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Install Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Run pre-commit checks
uses: pre-commit/[email protected]
unit-tests:
name: "Unit tests - ${{ matrix.OS }} - Python ${{ matrix.PYTHON_VERSION }}"
runs-on: ubuntu-latest
env:
CI: True
strategy:
fail-fast: true
matrix:
PYTHON_VERSION: ['3.9', '3.10', '3.11']
OS: ['ubuntu-latest', 'windows-latest']
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.PYTHON_VERSION }}
miniforge-variant: Mambaforge
miniforge-version: 4.11.0-2
use-mamba: true
environment-file: environment.yml
activate-environment: pytsql
- name: Run Unit Tests
shell: bash -l {0}
run: |
pip install . --no-build-isolation --no-deps --disable-pip-version-check
pytest tests/unit
linux-integration_tests-sqlserver:
name: "Linux - integration tests - Python ${{ matrix.PYTHON_VERSION }} - mssql"
runs-on: ubuntu-latest
env:
CI: True
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['3.9', '3.10', '3.11']
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
with:
ref: ${{ github.head_ref }}
- name: Fetch full git history
run: git fetch --prune --unshallow
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.PYTHON_VERSION }}
miniforge-variant: Mambaforge
miniforge-version: 4.11.0-2
use-mamba: true
environment-file: environment.yml
activate-environment: pytsql
- name: Install msodbcsql17 driver
shell: bash -l {0}
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 Unit Tests
shell: bash -l {0}
run: |
pip install . --no-build-isolation --no-deps --disable-pip-version-check
pytest --backend=mssql tests/integration