From 2a0a7fc689e3c3bbf9447fe47385cb980f1c7e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Hiszpa=C5=84ski?= Date: Wed, 10 Apr 2024 18:35:02 +0200 Subject: [PATCH 1/2] Fixed badge generation --- .github/workflows/main.yml | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c7b96e2..f755a54 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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/master' + id: jacoco uses: cicirello/jacoco-badge-generator@v2.9.0 with: generate-branches-badge: true - name: Log coverage percentage + if: github.ref == 'refs/heads/master' 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/master' uses: EndBug/add-and-commit@v9.1.1 with: default_author: github_actions From bad423ac0bb0c7c6685857bd99679cd01b2f8fab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Hiszpa=C5=84ski?= Date: Wed, 10 Apr 2024 18:35:02 +0200 Subject: [PATCH 2/2] Fixed badge generation --- .github/workflows/main.yml | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c7b96e2..086856c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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/main' + id: jacoco uses: cicirello/jacoco-badge-generator@v2.9.0 with: generate-branches-badge: true - name: Log coverage percentage + if: github.ref == 'refs/heads/main' 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/main' uses: EndBug/add-and-commit@v9.1.1 with: default_author: github_actions