Skip to content

Commit

Permalink
Fixed: Failed backend test due to empty code coverage badge commit & …
Browse files Browse the repository at this point in the history
…push step issue (#663)

* ci: Allow code coverage badge push step to fail

* ci: Only commit & push code coverage badge if it differs from the existing one
  • Loading branch information
drikusroor authored Dec 18, 2023
1 parent 499556d commit bfc6e04
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
sudo docker-compose --env-file .env-github-actions run server bash -c "genbadge coverage -i coverage.xml -o coverage-backend-badge-new.svg -n \"Backend Code Coverage\""
# Push coverage badge to separate branch (only for main and develop branches)
- name: Push Backend Coverage Badge to separate branch
continue-on-error: true
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
run: |
if git ls-remote --heads origin code-coverage-badges; then
Expand All @@ -39,6 +40,13 @@ jobs:
git add backend/coverage-backend-badge.svg
git commit -m "Add backend coverage badge for commit $GITHUB_SHA"
git push origin code-coverage-badges
# Check if there are any changes
if git diff --staged --quiet; then
echo "No changes in coverage badge. Skipping commit and push."
else
git commit -m "Add backend coverage badge for commit $GITHUB_SHA"
git push origin code-coverage-badges
fi
backend-lint:
name: Lint Backend
Expand Down

0 comments on commit bfc6e04

Please sign in to comment.