♻️ Refactor: Partial constant extraction in the backend #117
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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-latest"]' | |
| 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-latest"]') }} | |
| 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 | |
| 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 | |
| directory: . |