Skip to content

Commit

Permalink
update test-frontend-backend.yml : ajouter le dossier coverage/bobapp…
Browse files Browse the repository at this point in the history
… si nécessaire, et afficher un avertissement si le rapport n'est pas généré.
  • Loading branch information
Micheeeeel committed Oct 24, 2023
1 parent 564cbbb commit 48b59bd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/test-frontend-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,28 @@ jobs:
cache: "npm"
cache-dependency-path: front/package-lock.json
- run: npm ci
- name: Ensure coverage directory exists
run: mkdir -p coverage/bobapp
- name: Run tests and generate coverage report
run: npm run test -- --no-watch --no-progress --browsers=ChromeHeadless --code-coverage
- name: List coverage directory
run: ls -la coverage/bobapp
- name: Run Sonar analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
COVERAGE_REPORT_PATH: ./front/coverage/bobapp/report-lcovonly.txt
- name: Check if coverage report exists
run: |
if [ ! -f "$COVERAGE_REPORT_PATH" ]; then
echo "⚠️ Warning: Coverage report not found at $COVERAGE_REPORT_PATH!"
else
echo "Coverage report found at $COVERAGE_REPORT_PATH."
fi
run: npm run sonar


test-backend:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 48b59bd

Please sign in to comment.