Skip to content

Commit

Permalink
Fixed badge generation
Browse files Browse the repository at this point in the history
  • Loading branch information
RHarryH committed Apr 10, 2024
1 parent ae166dd commit 21a0f55
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,21 @@ jobs:
- name: Build with Maven
run: mvn -Davispa.ecm.office.home='/usr/lib/libreoffice' -B verify

- name: Upload JaCoCo coverage report
uses: actions/upload-artifact@v3.1.1
with:
name: jacoco-report
path: target/site/jacoco/

generate_badges:
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
needs: build_job
steps:
- name: Get JaCoCo coverage report
uses: actions/download-artifact@v3.0.2
with:
name: jacoco-report
path: target/site/jacoco/

- name: Generate JaCoCo Badge
if: github.ref == 'refs/heads/develop'
id: jacoco
uses: cicirello/jacoco-badge-generator@v2.9.0
with:
generate-branches-badge: true

- name: Log coverage percentage
if: github.ref == 'refs/heads/develop'
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}"
- name: Shallow Checkout
uses: actions/checkout@v3.2.0
with:
fetch-depth: 1

- name: Commit and push the badge (if it changed)
if: github.ref == 'refs/heads/develop'
uses: EndBug/add-and-commit@v9.1.1
with:
default_author: github_actions
Expand Down

0 comments on commit 21a0f55

Please sign in to comment.