Skip to content

Commit

Permalink
[#258] Cleanup CI and Test Badge Creation
Browse files Browse the repository at this point in the history
  • Loading branch information
rjbrown2 authored Dec 19, 2024
1 parent ca38c91 commit 6230385
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/mc_dc_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6230385

Please sign in to comment.