Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed badges generation #14

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/badges/branches.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .github/badges/jacoco.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Loading