Skip to content

feat: Add developer experience for local changes deployment with custom image #1158

feat: Add developer experience for local changes deployment with custom image

feat: Add developer experience for local changes deployment with custom image #1158

Workflow file for this run

name: Test Workflow with Coverage - KM Generic
on:
push:
branches:
- main
- dev
- demo
- psl-backend-unittest
pull_request:
types:
- opened
- ready_for_review
- reopened
- synchronize
branches:
- main
- dev
- demo
jobs:
# frontend_tests:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v5
# - name: Set up Node.js
# uses: actions/setup-node@v3
# with:
# node-version: '20'
# - name: Check if Frontend Test Files Exist
# id: check_frontend_tests
# run: |
# if [ -z "$(find App/frontend/src -type f -name '*.test.js' -o -name '*.test.ts' -o -name '*.test.tsx')" ]; then
# echo "No frontend test files found, skipping frontend tests."
# echo "skip_frontend_tests=true" >> $GITHUB_ENV
# else
# echo "Frontend test files found, running tests."
# echo "skip_frontend_tests=false" >> $GITHUB_ENV
# fi
# - name: Install Frontend Dependencies
# if: env.skip_frontend_tests == 'false'
# run: |
# cd App/frontend
# npm install
# - name: Run Frontend Tests with Coverage
# if: env.skip_frontend_tests == 'false'
# run: |
# cd App/frontend
# npm run test -- --coverage
# - name: Skip Frontend Tests
# if: env.skip_frontend_tests == 'true'
# run: |
# echo "Skipping frontend tests because no test files were found."
backend_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install Backend Dependencies
run: |
python -m pip install --upgrade pip
pip install -r src/api/requirements.txt
pip install pytest-cov
pip install pytest-asyncio
- name: Check if Backend Test Files Exist
id: check_backend_tests
run: |
if [ -z "$(find src/tests/api -type f -name 'test_*.py')" ]; then
echo "No backend test files found, skipping backend tests."
echo "skip_backend_tests=true" >> $GITHUB_ENV
else
echo "Backend test files found, running tests."
echo "skip_backend_tests=false" >> $GITHUB_ENV
fi
- name: Run Backend Tests with Coverage
if: env.skip_backend_tests == 'false'
run: |
pytest --cov=. --cov-report=term-missing --cov-report=xml ./src/tests/api
- name: Skip Backend Tests
if: env.skip_backend_tests == 'true'
run: |
echo "Skipping backend tests because no test files were found."