Skip to content

Commit 2efc942

Browse files
committed
added ci
1 parent a4fde4e commit 2efc942

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

.github/workflows/test-backend.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test Backend
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
12+
jobs:
13+
test-backend:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.10"
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v3
24+
with:
25+
version: "0.4.15"
26+
enable-cache: true
27+
- run: docker compose down -v --remove-orphans
28+
- run: docker compose up -d db mailcatcher
29+
- name: Migrate DB
30+
run: uv run bash scripts/prestart.sh
31+
working-directory: backend
32+
- name: Run tests
33+
run: uv run bash scripts/tests-start.sh "Coverage for ${{ github.sha }}"
34+
working-directory: backend
35+
- run: docker compose down -v --remove-orphans
36+
- name: Store coverage files
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: coverage-html
40+
path: backend/htmlcov
41+
include-hidden-files: true
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Test Docker Compose
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
12+
jobs:
13+
14+
test-docker-compose:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
- run: docker compose build
20+
- run: docker compose down -v --remove-orphans
21+
- run: docker compose up -d --wait
22+
- name: Test backend is up
23+
run: curl http://localhost:8000/api/v1/utils/health-check
24+
- name: Test frontend is up
25+
run: curl http://localhost:5173
26+
- run: docker compose down -v --remove-orphans

0 commit comments

Comments
 (0)