-
Notifications
You must be signed in to change notification settings - Fork 174
50 lines (43 loc) · 1.3 KB
/
margin_app_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
name: Margin Tests
on:
push:
branches:
- main
paths:
- 'margin_app/**'
pull_request:
branches:
- main
paths:
- 'margin_app/**'
jobs:
shared:
uses: ./.github/workflows/shared_workflow.yml
with:
python-version: "3.12"
margin-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create .env file
run: cp margin_app/.env.dev margin_app/.env
- name: Build and Start Containers
run: |
docker compose -f margin_app/docker-compose.yml --env-file margin_app/.env up -d --build
echo "Waiting for containers to be ready..."
sleep 30
- name: Run Integration Tests with Coverage
run: |
docker compose -f margin_app/docker-compose.yml exec backend python -m pytest app/tests -v
- name: Clean Up
if: always()
run: |
docker compose -f margin_app/docker-compose.yml logs > docker-logs.txt || true
docker compose -f margin_app/docker-compose.yml down -v
- name: Upload Docker Logs on Failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: docker-logs
path: docker-logs.txt