-
Notifications
You must be signed in to change notification settings - Fork 64
86 lines (70 loc) · 1.96 KB
/
Copy pathci-backend.yml
File metadata and controls
86 lines (70 loc) · 1.96 KB
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
name: Backend CI
on:
push:
branches: [main, develop]
paths:
- 'backend/**'
- '.github/workflows/ci-backend.yml'
pull_request:
branches: [main, develop]
paths:
- 'backend/**'
defaults:
run:
working-directory: backend
env:
PYTHON_VERSION: '3.11'
jobs:
lint:
name: Lint & Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: uv sync --all-packages
- name: Run Ruff check
run: uv run ruff check .
- name: Run Ruff format check
run: uv run ruff format --check .
- name: Run Pyright
run: uv run pyright
test:
name: Tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: glean_test
POSTGRES_USER: glean
POSTGRES_PASSWORD: testpassword
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:8-alpine
ports:
- 6379:6379
steps:
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Set up Python
run: uv python install ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: uv sync --all-packages
- name: Run tests
env:
DATABASE_URL: postgresql+asyncpg://glean:testpassword@localhost:5432/glean_test
TEST_DATABASE_URL: postgresql+asyncpg://glean:testpassword@localhost:5432/glean_test
REDIS_URL: redis://localhost:6379/0
run: uv run pytest --cov --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
files: backend/coverage.xml
flags: backend