-
Notifications
You must be signed in to change notification settings - Fork 639
79 lines (69 loc) · 2.1 KB
/
Copy pathauto-unit-test.yml
File metadata and controls
79 lines (69 loc) · 2.1 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: Run Automated Unit Tests
concurrency:
group: automated-unit-test-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
runner_label_json:
description: 'runner array in json format (e.g. ["ubuntu-latest"] or ["self-hosted"])'
required: false
default: '["ubuntu-24.04-arm"]'
pull_request:
branches: [develop, 'release/**', 'hotfix/**']
paths:
- 'backend/**'
- 'sdk/**'
- 'test/**'
- '.github/workflows/**'
push:
branches: [develop, 'release/**', 'hotfix/**']
paths:
- 'backend/**'
- 'sdk/**'
- 'test/**'
- '.github/workflows/**'
jobs:
test:
runs-on: ${{ fromJson(github.event.inputs.runner_label_json || '["ubuntu-24.04-arm"]') }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install uv
run: pip install --upgrade uv
- name: Install dependencies
run: |
cd backend
uv sync --extra data-process --extra test
uv pip install -e "../sdk[dev]"
cd ..
- name: Run all tests and collect coverage
run: |
source backend/.venv/bin/activate && python test/run_all_test.py
TEST_EXIT_CODE=$?
if [ -f "test/coverage.xml" ]; then
echo "✅ Coverage XML file generated successfully."
else
echo "❌ Coverage XML file not found."
exit 1
fi
# Check if tests actually passed
if [ $TEST_EXIT_CODE -ne 0 ]; then
echo "❌ Tests failed with exit code $TEST_EXIT_CODE"
exit $TEST_EXIT_CODE
else
echo "✅ All tests passed successfully."
fi
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: test/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
verbose: true