Skip to content

Commit

Permalink
add backend coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jayeshsadhwani99 committed Aug 12, 2024
1 parent 890a66f commit 080f6ac
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,28 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

# Backend Setup and Testing
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install Backend Dependencies
run: pip install -r requirements.txt

- name: Run Backend Unit Tests
run: |
pytest --html=report.html --self-contained-html --cov=. --cov-report=html
ls -R
- name: Debug Backend Report
run: |
echo "Checking if report.html exists"
if [ ! -f report.html ]; then
echo "report.html not found!"
exit 1
fi
# Frontend Setup and Testing
- name: Set up Node.js
uses: actions/setup-node@v3
Expand All @@ -41,9 +63,16 @@ jobs:
run: |
mkdir -p ./public/reports/frontend
mkdir -p ./public/reports/frontend/coverage
mv ./web/reports/test-report.html ./public/reports/frontend/
mv ./web/coverage/lcov-report/* ./public/reports/frontend/coverage/
mkdir -p ./public/reports/backend
mkdir -p ./public/reports/backend/coverage
mv report.html ./public/reports/backend/
mv htmlcov/* ./public/reports/backend/coverage/
# Deploy reports to GitHub Pages
- name: Deploy to GitHub Pages
if: success()
Expand Down

0 comments on commit 080f6ac

Please sign in to comment.