-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#258] Cleanup CI and Test Badge Creation
- Loading branch information
Showing
1 changed file
with
3 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Fetch full history | ||
fetch-depth: 0 # Fetch full history for branch operations | ||
|
||
# Install dependencies and setup environment | ||
- name: Install Dependencies | ||
|
@@ -63,22 +63,15 @@ jobs: | |
curl -o coverage/line-coverage-badge.svg "https://img.shields.io/badge/line%20coverage-${LINE_COVERAGE_PERCENT}%25-brightgreen" | ||
curl -o coverage/branch-coverage-badge.svg "https://img.shields.io/badge/branch%20coverage-${BRANCH_COVERAGE_PERCENT}%25-brightgreen" | ||
# Fix detached HEAD state | ||
- name: Fix Detached HEAD | ||
run: git checkout -B ${GITHUB_REF##*/} | ||
working-directory: ${{ github.workspace }} | ||
|
||
# Commit badges to a separate branch | ||
# Commit badges to the current branch | ||
- name: Commit Coverage Badges | ||
if: ${{ github.event_name == 'push' }} | ||
run: | | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
git checkout -b badges || git checkout badges | ||
git add coverage/line-coverage-badge.svg | ||
git add coverage/branch-coverage-badge.svg | ||
git commit -m "Update coverage badges" | ||
git push origin badges | ||
git push origin HEAD | ||
working-directory: ${{ github.workspace }} | ||
|
||
# Upload consolidated coverage report as an artifact | ||
|