-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (50 loc) · 1.52 KB
/
pytest.yaml
File metadata and controls
58 lines (50 loc) · 1.52 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
name: Tests with pytest in dev
on:
push:
branches:
- main
paths:
- "**/*.py"
pull_request:
branches:
- main
paths:
- "**/*.py"
jobs:
test:
runs-on: ubuntu-latest
environment: dev
services:
mongodb:
image: mongo:8.2.2-noble
env:
MONGO_INITDB_ROOT_USERNAME: ${{ secrets.MONGO_INITDB_ROOT_USERNAME }}
MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.MONGO_INITDB_ROOT_PASSWORD }}
MONGO_INITDB_DATABASE: ${{ secrets.MONGO_INITDB_DATABASE }}
ports:
- 27017:27017
options: >-
--health-cmd "mongosh --eval 'db.runCommand({ ping: 1 })'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install the project
run: uv sync --frozen --group dev
- name: Run pytest with coverage
env:
ME_CONFIG_MONGODB_URL: mongodb://${{ secrets.MONGO_INITDB_ROOT_USERNAME }}:${{ secrets.MONGO_INITDB_ROOT_PASSWORD }}@localhost:27017/${{ secrets.MONGO_INITDB_DATABASE }}?authSource=admin
MONGO_INITDB_DATABASE: ${{ secrets.MONGO_INITDB_DATABASE }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
JWT_ALGORITHM: ${{ secrets.JWT_ALGORITHM }}
run: uv run pytest