Skip to content

✨ Kubernetes Helm deployment directory reconstruction #2722 #1363

✨ Kubernetes Helm deployment directory reconstruction #2722

✨ Kubernetes Helm deployment directory reconstruction #2722 #1363

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]
paths:
- 'backend/**'
- 'sdk/**'
- 'test/**'
- '.github/workflows/**'
push:
branches: [develop]
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
# Detect architecture
- name: Detect architecture
id: arch
run: echo "arch=$(uname -m)" >> $GITHUB_OUTPUT
# Use Python uploader on ARM
- name: Upload coverage to Codecov (Python uploader on ARM)
if: startsWith(steps.arch.outputs.arch, 'arm') || startsWith(steps.arch.outputs.arch, 'aarch64')
run: |
pip install --upgrade codecov
codecov \
-t ${{ secrets.CODECOV_TOKEN }} \
-f test/coverage.xml \
-F unittests \
-n codecov-umbrella \
-v
# Use official action on x86
- name: Upload coverage to Codecov (Official Action on x86)
if: steps.arch.outputs.arch == 'x86_64'
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
directory: .