From a09a76f7f1e58189babbac8a8e7b0b0d460ac7c8 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:11:46 +0200 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d957d0f..f6c64ec 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,3 +39,27 @@ jobs: run: | mkdir -p coverage cp -r SYG-bootstrap/target/site/jacoco-aggregate/* coverage/ + + - name: Hacer commit y push de la cobertura + run: | + git add coverage + git commit -m "Agregar reporte de cobertura" + git push + + - name: Obtener cobertura + id: obtener-cobertura + run: | + cobertura=$(awk '/^TOTAL/{print $NF}' SYG-bootstrap/target/site/jacoco/index.html) + echo "::set-output name=cobertura::$cobertura" + + - name: Generar badge de cobertura + run: | + curl -o backend-coverage-badge.svg "https://img.shields.io/badge/backend%20cobertura-${{ steps.obtener-cobertura.outputs.cobertura }}%25-green" + + - name: Guardar badge en el repositorio + run: | + git add backend-coverage-badge.svg + git commit -m "Agregar badge de cobertura del backend" + git push + +