Skip to content

Commit 88d2f9a

Browse files
committed
add tests for ci pipe
1 parent 00434c0 commit 88d2f9a

File tree

2 files changed

+54
-11
lines changed

2 files changed

+54
-11
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: CI
22
on:
33
push:
4-
branches: [ main, ci-test ]
4+
branches: [ main, develop ]
55

66
jobs:
77
check:
@@ -25,3 +25,56 @@ jobs:
2525
run: uv run ruff format --check lemur
2626
- name: mypy check
2727
run: uv run mypy lemur
28+
29+
test:
30+
name: Tests (py${{ matrix.python }} / pg${{ matrix.postgres }})
31+
runs-on: ubuntu-22.04
32+
33+
strategy:
34+
matrix:
35+
python: [ "3.10", "3.11", "3.12" ]
36+
postgres: [ 14, 15, 16, 17, 18 ]
37+
38+
services:
39+
postgres:
40+
image: postgres:${{ matrix.postgres }}
41+
env:
42+
POSTGRES_USER: lemur
43+
POSTGRES_PASSWORD: lemur
44+
POSTGRES_DB: lemur
45+
options: >-
46+
--health-cmd "pg_isready -U lemur"
47+
--health-interval 5s
48+
--health-timeout 5s
49+
--health-retries 3
50+
ports:
51+
- 5432:5432
52+
53+
env:
54+
SQLALCHEMY_DATABASE_URI: postgresql://lemur:lemur@localhost:5432/lemur
55+
BOTO_CONFIG: /doesnotexist
56+
PY_COLORS: "1"
57+
FORCE_COLOR: "1"
58+
59+
steps:
60+
- uses: actions/checkout@v6
61+
62+
- name: Install uv
63+
uses: astral-sh/setup-uv@v7
64+
65+
- name: Set Python ${{ matrix.python }}
66+
run: uv python install ${{ matrix.python }}
67+
68+
- name: Install system deps
69+
run: |
70+
sudo apt-get update
71+
sudo apt-get install -y \
72+
libsasl2-dev \
73+
libldap2-dev
74+
75+
- name: Sync runtime + dev deps
76+
run: uv sync --frozen --dev --group tests
77+
78+
- name: Run tests
79+
run: |
80+
uv run pytest --cov=lemur --cov-report=xml

.github/workflows/release.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)