Thanks to visit codestin.com
Credit goes to github.com

Skip to content

YAAF: Fix Python binary path when calling subprocess #70

YAAF: Fix Python binary path when calling subprocess

YAAF: Fix Python binary path when calling subprocess #70

Workflow file for this run

name: Test Coverage
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
backend-tests:
name: Backend Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
working-directory: ./src
run: |
python -m pip install --upgrade pip
pip install hatch
hatch -e dev run pip install -r backend/requirements.txt
- name: Run tests with coverage
working-directory: ./src
env:
DATABRICKS_HOST: https://test.databricks.com
DATABRICKS_WAREHOUSE_ID: test_warehouse_id
DATABRICKS_CATALOG: test_catalog
DATABRICKS_SCHEMA: test_schema
DATABRICKS_VOLUME: test_volume
APP_AUDIT_LOG_DIR: /tmp/audit_logs
run: |
hatch -e dev run pytest \
--cov=backend/src \
--cov-report=xml \
--cov-report=term \
--cov-report=html \
-v
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
files: ./src/coverage.xml
flags: backend
name: backend-coverage
fail_ci_if_error: false
- name: Upload HTML coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: backend-coverage-html
path: ./src/backend/htmlcov/
- name: Check coverage threshold
working-directory: ./src
env:
DATABRICKS_HOST: https://test.databricks.com
DATABRICKS_WAREHOUSE_ID: test_warehouse_id
DATABRICKS_CATALOG: test_catalog
DATABRICKS_SCHEMA: test_schema
DATABRICKS_VOLUME: test_volume
APP_AUDIT_LOG_DIR: /tmp/audit_logs
run: |
hatch -e dev run pytest \
--cov=backend/src \
--cov-fail-under=80 \
--cov-report=term-missing
frontend-tests:
name: Frontend Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'yarn'
cache-dependency-path: './src/frontend/yarn.lock'
- name: Install dependencies
working-directory: ./src/frontend
run: yarn install --frozen-lockfile
- name: Run tests with coverage
working-directory: ./src/frontend
run: yarn test:coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
files: ./src/frontend/coverage/lcov.info
flags: frontend
name: frontend-coverage
fail_ci_if_error: false
- name: Upload HTML coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: frontend-coverage-html
path: ./src/frontend/coverage/
- name: Check coverage threshold
working-directory: ./src/frontend
run: |
# vitest already fails if thresholds not met (configured in vitest.config.ts)
echo "Coverage thresholds checked by vitest"
e2e-tests:
name: E2E Tests
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'yarn'
cache-dependency-path: './src/frontend/yarn.lock'
- name: Install dependencies
working-directory: ./src/frontend
run: yarn install --frozen-lockfile
- name: Install Playwright browsers
working-directory: ./src/frontend
run: npx playwright install --with-deps chromium
- name: Run E2E tests
working-directory: ./src/frontend
run: yarn test:e2e
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: ./src/frontend/playwright-report/
retention-days: 7
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-results
path: ./src/frontend/test-results/
retention-days: 7
type-check:
name: TypeScript Type Check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'yarn'
cache-dependency-path: './src/frontend/yarn.lock'
- name: Install dependencies
working-directory: ./src/frontend
run: yarn install --frozen-lockfile
- name: Run type check
working-directory: ./src/frontend
run: yarn type-check
coverage-report:
name: Coverage Report
runs-on: ubuntu-latest
needs: [backend-tests, frontend-tests]
if: always()
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download backend coverage
uses: actions/download-artifact@v4
with:
name: backend-coverage-html
path: ./coverage/backend
- name: Download frontend coverage
uses: actions/download-artifact@v4
with:
name: frontend-coverage-html
path: ./coverage/frontend
- name: Create coverage summary
run: |
echo "# Test Coverage Summary" > coverage-summary.md
echo "" >> coverage-summary.md
echo "Coverage reports available in artifacts:" >> coverage-summary.md
echo "- Backend: coverage/backend/" >> coverage-summary.md
echo "- Frontend: coverage/frontend/" >> coverage-summary.md
- name: Upload combined coverage
uses: actions/upload-artifact@v4
with:
name: combined-coverage-reports
path: ./coverage/