[workflows]: Specify PYTHONPATH explicitly
This commit is contained in:
27
.github/workflows/ci.yml
vendored
27
.github/workflows/ci.yml
vendored
@ -4,6 +4,9 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@ -28,16 +31,30 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r server/src/requirements.txt
|
||||
pip install -r requirements.txt
|
||||
|
||||
# Run tests with coverage
|
||||
# Run tests and generate coverage report
|
||||
- name: Run tests with coverage
|
||||
run: PYTHONPATH=$(pwd)/src pytest --cov=src/functions --cov-report=html
|
||||
#
|
||||
run: |
|
||||
export PYTHONPATH=$(pwd)/server/src # Fix: Set PYTHONPATH
|
||||
pytest --cov=src/functions --cov-report=term-missing --cov-report=xml --cov-report=html
|
||||
|
||||
# Upload coverage report as an artifact
|
||||
- name: Upload coverage report (HTML)
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage-report-html
|
||||
path: htmlcov/
|
||||
|
||||
# Upload XML coverage report for CI tools
|
||||
- name: Upload coverage report (XML)
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage-report-xml
|
||||
path: coverage.xml
|
||||
|
||||
# Show coverage summary in logs
|
||||
- name: Show coverage summary
|
||||
run: cat coverage.xml
|
||||
|
Reference in New Issue
Block a user