-
Notifications
You must be signed in to change notification settings - Fork 314
79 lines (69 loc) · 2.32 KB
/
core-test.yaml
File metadata and controls
79 lines (69 loc) · 2.32 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
name: Core Test
on:
push:
branches:
- dev
paths:
- 'src/server/core/**'
- '.github/workflows/core-test.yaml'
pull_request:
branches:
- dev
paths:
- 'src/server/core/**'
- '.github/workflows/core-test.yaml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Tests on ${{ matrix.os }} for ${{ matrix.python-version }}
strategy:
matrix:
python-version: [3.13]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
permissions:
contents: read
defaults:
run:
working-directory: src/server/
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57
- name: Set up Python
run: uv python install
- name: Install dependencies
run: |
cd core
uv sync --frozen --no-dev --no-cache-dir
- name: Start containers
working-directory: src/server
run: |
cp .env.example .env
cp core/config.yaml.example core/config.yaml
if ! docker compose up -d --wait --quiet-pull acontext-server-pg acontext-server-redis acontext-server-seaweedfs acontext-server-seaweedfs-setup 2>&1; then
echo "❌ Docker compose failed to start, showing logs:"
docker compose logs
exit 1
fi
echo "✅ All containers started successfully"
- name: Test with pytest
run: |
cd core
uv run -m pytest --junit-xml=junit/test-results-${{ matrix.python-version }}.xml --cov=. --cov-report=xml:coverage-${{ matrix.python-version }}.xml tests/ -s -v
- name: Upload pytest test results and coverage
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: pytest-results-${{ matrix.python-version }}
path: |
./src/server/core/junit/test-results-${{ matrix.python-version }}.xml
./src/server/core/coverage-${{ matrix.python-version }}.xml
retention-days: 30
if: ${{ always() }}
- name: Stop containers
if: ${{ always() }}
run: |
docker compose down