-
Notifications
You must be signed in to change notification settings - Fork 75
66 lines (64 loc) · 2.23 KB
/
tests.yml
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
on:
push:
branches:
- main
workflow_dispatch: {}
workflow_call: {}
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
strategy:
matrix:
# I tried running stuff on macOS but it was too slow and unreliable.
# I also tried windows runners but couldn't get Docker to work there, so I gave up.
os: [ubuntu-latest]
python-version: ['3.10', '3.11', '3.12']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: install Microsoft ODBC
if: matrix.os == 'ubuntu-latest'
run: sudo ACCEPT_EULA=Y apt-get install msodbcsql18 -y
- name: install Microsoft ODBC
if: matrix.os == 'macos-13'
run: |
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
HOMEBREW_ACCEPT_EULA=Y brew install msodbcsql18
- name: Install Docker on macOS
if: matrix.os == 'macos-13'
run: |
brew install docker
brew install docker-compose
brew install colima
colima start
# Wait for Docker daemon to be ready
while ! docker system info > /dev/null 2>&1; do sleep 1; done
- name: install Microsoft ODBC
if: matrix.os == 'windows-latest'
run: |
Invoke-WebRequest -Uri https://go.microsoft.com/fwlink/?linkid=2249006 -OutFile msodbcsql.msi
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i msodbcsql.msi /qn /norestart IACCEPTMSODBCSQLLICENSETERMS=YES" -Wait
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: install uv
uses: astral-sh/setup-uv@v3
- name: Install pip dependencies
run: make deps-ci
- name: run tests (macOS)
if: matrix.os == 'macos-13'
run: make test-ci
env:
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: /var/run/docker.sock
DOCKER_HOST: unix:///Users/runner/.colima/docker.sock
- name: run tests (other OS)
if: matrix.os != 'macos-13'
run: make test-ci
- name: check the formatting
run: make lint-ci