-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.19 KB
/
Copy pathci.yml
File metadata and controls
47 lines (40 loc) · 1.19 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
name: WorkSynapse CI
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
jobs:
test:
runs-on: ubuntu-latest
env:
PROJECT_NAME: "WorkSynapse API Test"
API_V1_STR: "/api/v1"
SECRET_KEY: "test_secret_key_for_ci_pipeline_only"
SERVICE_API_KEY: "test_service_key"
POSTGRES_USER: "test"
POSTGRES_PASSWORD: "test"
POSTGRES_DB: "test_db"
POSTGRES_HOST: "localhost"
POSTGRES_PORT: 5432
DATABASE_URL: "sqlite+aiosqlite:///:memory:"
PYTHONPATH: ${{ github.workspace }}/backend
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-asyncio pytest-cov httpx faker aiosqlite sqlalchemy
pip install -r backend/requirements.txt
- name: Run Tests
run: |
cd backend
pytest tests/ --cov=app --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}