From 3eed0e7a8b4ad15c10dc8e43496655564f62ade4 Mon Sep 17 00:00:00 2001 From: androdfer1 Date: Sun, 11 May 2025 22:41:08 +0200 Subject: [PATCH 1/4] Update pruebas.yml --- .github/workflows/pruebas.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pruebas.yml b/.github/workflows/pruebas.yml index 2db842e3..0a60f83f 100644 --- a/.github/workflows/pruebas.yml +++ b/.github/workflows/pruebas.yml @@ -1,4 +1,5 @@ name: Flujo de trabajo para ejecutar los test + on: workflow_dispatch: push: @@ -7,6 +8,7 @@ on: branches: [ V.0.2 ] schedule: - cron: '1 23 * * 0-4' + jobs: Build: runs-on: ubuntu-latest @@ -22,7 +24,27 @@ jobs: with: distribution: 'temurin' java-version: '16' - - name: Construyendo y probando el código + - name: Construyendo el código run: | - chmod +x gradlew + chmod +x gradlew ./gradlew build + + Test: + runs-on: ubuntu-latest + needs: Build + env: + GITHUB_LOGIN: ${{ github.actor }} + GITHUB_PACKAGES: ${{ secrets.GHTOKEN }} + GITHUB_OAUTH: ${{ secrets.GHTOKEN }} + steps: + - name: Clonando el repositorio y estableciendo el espacio de trabajo + uses: actions/checkout@v3 + - name: Configurando java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '16' + - name: Ejecutando los test + run: | + chmod +x gradlew + ./gradlew test From 70aed1960f303257a05f682c5549d5ff7e9a608b Mon Sep 17 00:00:00 2001 From: androdfer1 <101417616+andresbasket7@users.noreply.github.com> Date: Sun, 25 May 2025 11:29:08 +0200 Subject: [PATCH 2/4] Indicador_Grupo4 --- .gitignore | 5 +++-- build.gradle | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 98f048e4..dbf46327 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Ignore Gradle project-specific cache directory .gradle -#No quiero subir el fichero de configuración de gradle, porque contiene secretos +#No quiero subir el fichero de configuraci�n de gradle, porque contiene secretos gradle.properties #Ignoro los directorios que crea el IDE en el espacio de trabajo, que no se suba a git .settings @@ -17,6 +17,7 @@ bin # Ignorar el fichero de propiedades de gradle, porque tienen datos personales gradle.properties +config.properties # Compiled class file @@ -38,6 +39,6 @@ gradle.properties -#las pruebas harán generar informes excel, que no quiero subir al repositorio remoto +#las pruebas har�n generar informes excel, que no quiero subir al repositorio remoto *.xls /javadoc.xml diff --git a/build.gradle b/build.gradle index 95067239..853305cd 100644 --- a/build.gradle +++ b/build.gradle @@ -26,12 +26,13 @@ publishing { repositories { maven { name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/mit-fs/audit4improve-api") + url = uri("https://maven.pkg.github.com/androdfer1/audit4improve-api") credentials { //las propiedades gpr.user y gpr.key están configuradas en gradle.properties en el raiz del proyecto, y se añade a .gitignore para que no se suban //O bien configuro las variables de entorno GITHUB_LOGIN y GITHUB_PACKAGES username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_LOGIN") password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_PACKAGES") + } } } @@ -39,16 +40,16 @@ publishing { gpr(MavenPublication) { //Del tutorial https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven - groupId = 'us.mitfs.samples' - artifactId = 'a4i' - version = '0.2' + groupId = 'com.androdfer1' + artifactId = 'audit4improve-api' + version = '0.0.1-androdfer1' from components.java } } } -version = '0.2' +version = '0.0.1-androdfer1' //group = 'us.mitfs.samples' tasks.withType(JavaCompile) { //Añadir la opción Xlint From e20d6d7e6b410acea5c1be7f4e962d80ad0020e5 Mon Sep 17 00:00:00 2001 From: androdfer1 <101417616+andresbasket7@users.noreply.github.com> Date: Sun, 25 May 2025 11:31:46 +0200 Subject: [PATCH 3/4] Indicador_COD_TEST --- gradle-prueba/build.gradle | 16 ++ gradle/wrapper/gradle-wrapper.properties | 2 +- .../a4i/control/IndicatorStrategyEquipo4.java | 47 +++++ .../muit/fs/a4i/model/entities/ReportI.java | 7 - .../a4i/model/entities/impl/SimpleReport.java | 64 +++++++ .../model/entities/impl/SimpleReportItem.java | 72 ++++++++ .../remote/GitHubRemoteEnquirerEquipo4.java | 161 ++++++++++++++++++ .../control/IndicatorStrategyEquipo4Test.java | 72 ++++++++ .../GitHubRemoteEnquirerEquipo4Test.java | 64 +++++++ 9 files changed, 497 insertions(+), 8 deletions(-) create mode 100644 gradle-prueba/build.gradle create mode 100644 src/main/java/us/muit/fs/a4i/control/IndicatorStrategyEquipo4.java create mode 100644 src/main/java/us/muit/fs/a4i/model/entities/impl/SimpleReport.java create mode 100644 src/main/java/us/muit/fs/a4i/model/entities/impl/SimpleReportItem.java create mode 100644 src/main/java/us/muit/fs/a4i/model/remote/GitHubRemoteEnquirerEquipo4.java create mode 100644 src/test/java/us/muit/fs/a4i/test/control/IndicatorStrategyEquipo4Test.java create mode 100644 src/test/java/us/muit/fs/a4i/test/model/remote/GitHubRemoteEnquirerEquipo4Test.java diff --git a/gradle-prueba/build.gradle b/gradle-prueba/build.gradle new file mode 100644 index 00000000..7da97a50 --- /dev/null +++ b/gradle-prueba/build.gradle @@ -0,0 +1,16 @@ +String nombre + +tasks.register('dependiente') { + /*dependsOn 'independiente'*/ + doLast { + println "Su nombre es: $nombre" + } +} + +tasks.register('independiente') { + doLast { + nombre = 'Isabel' + println "El nombre original es: $nombre" + println "En mayúsculas: ${nombre.toUpperCase()}" + } +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2733ed5d..8c06312e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists +zipStorePath=wrapper/dists \ No newline at end of file diff --git a/src/main/java/us/muit/fs/a4i/control/IndicatorStrategyEquipo4.java b/src/main/java/us/muit/fs/a4i/control/IndicatorStrategyEquipo4.java new file mode 100644 index 00000000..eec59893 --- /dev/null +++ b/src/main/java/us/muit/fs/a4i/control/IndicatorStrategyEquipo4.java @@ -0,0 +1,47 @@ +package us.muit.fs.a4i.control; + +import java.util.Arrays; +import java.util.List; + +import us.muit.fs.a4i.exceptions.NotAvailableMetricException; +import us.muit.fs.a4i.model.entities.ReportItemI; +import us.muit.fs.a4i.model.entities.impl.SimpleReportItem; + +public class IndicatorStrategyEquipo4 implements IndicatorStrategy { + + private static final String M1 = "issue_response_time"; + private static final String M2 = "issues_without_response_ratio"; + private static final String M3 = "resolved_under_48h_ratio"; + private static final String INDICATOR_NAME = "issue_management_speed"; + + @Override + public ReportItemI calcIndicator(List> metrics) throws NotAvailableMetricException { + Double m1 = null, m2 = null, m3 = null; + + for (ReportItemI metric : metrics) { + switch (metric.getName()) { + case M1: + m1 = metric.getValue(); + break; + case M2: + m2 = metric.getValue(); + break; + case M3: + m3 = metric.getValue(); + break; + } + } + + if (m1 == null || m2 == null || m3 == null) { + throw new NotAvailableMetricException("Faltan métricas necesarias para calcular el indicador."); + } + + double resultado = (m1 + m2 + m3) / 3.0; + return new SimpleReportItem(INDICATOR_NAME, resultado); + } + + @Override + public List requiredMetrics() { + return Arrays.asList(M1, M2, M3); + } +} \ No newline at end of file diff --git a/src/main/java/us/muit/fs/a4i/model/entities/ReportI.java b/src/main/java/us/muit/fs/a4i/model/entities/ReportI.java index fbbaeb20..20f5ddd7 100644 --- a/src/main/java/us/muit/fs/a4i/model/entities/ReportI.java +++ b/src/main/java/us/muit/fs/a4i/model/entities/ReportI.java @@ -84,11 +84,4 @@ public static enum ReportType { void addIndicator(ReportItemI newIndicator); - /** - * Calcula un indicador a partir de su nombre y lo añade al informe Si se basa - * en métricas que no están aún incluidas en el informe las incluye - * - * @param name Nombre del indicador que se quiere calcular - */ - } \ No newline at end of file diff --git a/src/main/java/us/muit/fs/a4i/model/entities/impl/SimpleReport.java b/src/main/java/us/muit/fs/a4i/model/entities/impl/SimpleReport.java new file mode 100644 index 00000000..ae5f5d6f --- /dev/null +++ b/src/main/java/us/muit/fs/a4i/model/entities/impl/SimpleReport.java @@ -0,0 +1,64 @@ +package us.muit.fs.a4i.model.entities.impl; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import us.muit.fs.a4i.model.entities.ReportI; +import us.muit.fs.a4i.model.entities.ReportItemI; + +public class SimpleReport implements ReportI { + + private String entityId; + private ReportType type; + + private Map metrics = new HashMap<>(); + private Map indicators = new HashMap<>(); + + public SimpleReport(String entityId, ReportType type) { + this.entityId = entityId; + this.type = type; + } + + @Override + public ReportType getType() { + return type; + } + + @Override + public String getEntityId() { + return entityId; + } + + @Override + public ReportItemI getMetricByName(String name) { + return metrics.get(name); + } + + @Override + public Collection getAllMetrics() { + return metrics.values(); + } + + @Override + public void addMetric(ReportItemI metric) { + metrics.put(metric.getName(), metric); + } + + @Override + public ReportItemI getIndicatorByName(String name) { + return indicators.get(name); + } + + @Override + public Collection getAllIndicators() { + return indicators.values(); + } + + @Override + public void addIndicator(ReportItemI newIndicator) { + indicators.put(newIndicator.getName(), newIndicator); + } + +} \ No newline at end of file diff --git a/src/main/java/us/muit/fs/a4i/model/entities/impl/SimpleReportItem.java b/src/main/java/us/muit/fs/a4i/model/entities/impl/SimpleReportItem.java new file mode 100644 index 00000000..84a59420 --- /dev/null +++ b/src/main/java/us/muit/fs/a4i/model/entities/impl/SimpleReportItem.java @@ -0,0 +1,72 @@ +package us.muit.fs.a4i.model.entities.impl; + +import us.muit.fs.a4i.model.entities.ReportItemI; +import us.muit.fs.a4i.model.entities.IndicatorI; + +import java.util.Date; + +public class SimpleReportItem implements ReportItemI { + + private String name; + private Double value; + private Date date; + private String description; + private String source; + private String unit; + private IndicatorI indicator; + + public SimpleReportItem(String name, Double value) { + this.name = name; + this.value = value; + this.date = new Date(); // asignamos la fecha actual por defecto + } + + public SimpleReportItem(String name, Double value, String description, String source, String unit) { + this.name = name; + this.value = value; + this.description = description; + this.source = source; + this.unit = unit; + this.date = new Date(); + } + + @Override + public String getName() { + return name; + } + + @Override + public Double getValue() { + return value; + } + + @Override + public Date getDate() { + return date; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public String getSource() { + return source; + } + + @Override + public String getUnit() { + return unit; + } + + @Override + public IndicatorI getIndicator() { + return indicator; + } + + // Setter si necesitamos añadir el indicador más tarde + public void setIndicator(IndicatorI indicator) { + this.indicator = indicator; + } +} \ No newline at end of file diff --git a/src/main/java/us/muit/fs/a4i/model/remote/GitHubRemoteEnquirerEquipo4.java b/src/main/java/us/muit/fs/a4i/model/remote/GitHubRemoteEnquirerEquipo4.java new file mode 100644 index 00000000..6984b90c --- /dev/null +++ b/src/main/java/us/muit/fs/a4i/model/remote/GitHubRemoteEnquirerEquipo4.java @@ -0,0 +1,161 @@ +package us.muit.fs.a4i.model.remote; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import java.io.InputStream; +import java.util.Properties; +import org.kohsuke.github.GHIssue; +import org.kohsuke.github.GHIssueComment; +import org.kohsuke.github.GHIssueState; +import org.kohsuke.github.GHRepository; +import org.kohsuke.github.GitHub; +import org.kohsuke.github.GitHubBuilder; + +import us.muit.fs.a4i.exceptions.MetricException; +import us.muit.fs.a4i.model.entities.Report; +import us.muit.fs.a4i.model.entities.ReportI; +import us.muit.fs.a4i.model.entities.ReportItemI; + +import us.muit.fs.a4i.model.entities.impl.*; + +public class GitHubRemoteEnquirerEquipo4 implements RemoteEnquirer { + + // Nombres de métricas + private static final String M1_NAME = "issue_response_time"; + private static final String M2_NAME = "issues_without_response_ratio"; + private static final String M3_NAME = "resolved_under_48h_ratio"; + + private GitHub github; + private static Properties properties = new Properties(); + + static { + try (InputStream input = GitHubRemoteEnquirerEquipo4.class.getClassLoader().getResourceAsStream("config.properties")) { + if (input == null) { + System.err.println("No se encontró el archivo config.properties en el classpath"); + } else { + properties.load(input); + } + } catch (IOException e) { + System.err.println("Error cargando config.properties: " + e.getMessage()); + } + } + + public GitHubRemoteEnquirerEquipo4() throws IOException { + String token = properties.getProperty("github.token"); + String apiUrl = properties.getProperty("github.api.url", "https://api.github.com"); + + if (token == null || token.isEmpty()) { + throw new IOException("Token de GitHub no configurado en config.properties"); + } + github = new GitHubBuilder().withEndpoint(apiUrl).withOAuthToken(token).build(); + } + + @Override + public ReportI buildReport(String entityId) { + Report report = new Report(ReportI.ReportType.REPOSITORY, entityId); + try { + report.addMetric(getMetric(M1_NAME, entityId)); + report.addMetric(getMetric(M2_NAME, entityId)); + report.addMetric(getMetric(M3_NAME, entityId)); + } catch (MetricException e) { + System.err.println("Error al obtener las métricas: " + e.getMessage()); + } + return report; + } + + @Override + public ReportItemI getMetric(String metricName, String entityId) throws MetricException { + try { + switch (metricName) { + case M1_NAME: + return new SimpleReportItem(M1_NAME, calcularM1(entityId)); + case M2_NAME: + return new SimpleReportItem(M2_NAME, calcularM2(entityId)); + case M3_NAME: + return new SimpleReportItem(M3_NAME, calcularM3(entityId)); + default: + throw new MetricException("Métrica no soportada: " + metricName); + } + } catch (IOException e) { + throw new MetricException("Error al conectar con GitHub: " + e.getMessage()); + } + } + + private double calcularM1(String repoFullName) throws IOException { + // Tiempo medio de respuesta en horas, máximo 72 + GHRepository repo = github.getRepository(repoFullName); + int totalIssues = 0; + double totalResponseTimeHours = 0; + + // Recorremos issues abiertas y cerradas + for (GHIssue issue : repo.getIssues(GHIssueState.ALL)) { + totalIssues++; + + List comments = issue.getComments(); + if (!comments.isEmpty()) { + // Tiempo desde apertura hasta primer comentario + long respuestaMillis = comments.get(0).getCreatedAt().getTime() - issue.getCreatedAt().getTime(); + double respuestaHoras = respuestaMillis / (1000.0 * 60 * 60); + totalResponseTimeHours += respuestaHoras; + } else { + // Sin respuesta, considerar 72 horas para cálculo + totalResponseTimeHours += 72; + } + } + + if (totalIssues == 0) return 1.0; // Sin issues = máximo índice + + double promedioHoras = totalResponseTimeHours / totalIssues; + + return promedioHoras <= 72 ? 1 - (promedioHoras / 72) : 0.0; + } + + private double calcularM2(String repoFullName) throws IOException { + GHRepository repo = github.getRepository(repoFullName); + int sinRespuesta = 0; + int totalIssues = 0; + + for (GHIssue issue : repo.getIssues(GHIssueState.OPEN)) { + totalIssues++; + if (issue.getComments().isEmpty()) { + sinRespuesta++; + } + } + if (totalIssues == 0) return 1.0; // Si no hay issues abiertos, ratio máximo + return 1.0 - ((double) sinRespuesta / totalIssues); + } + + private double calcularM3(String repoFullName) throws IOException { + GHRepository repo = github.getRepository(repoFullName); + int cerrados = 0; + int resueltos48h = 0; + + for (GHIssue issue : repo.getIssues(GHIssueState.CLOSED)) { + cerrados++; + long diffMillis = issue.getClosedAt().getTime() - issue.getCreatedAt().getTime(); + double horas = diffMillis / (1000.0 * 60 * 60); + if (horas <= 48) { + resueltos48h++; + } + } + + if (cerrados == 0) return 1.0; // Si no hay cerrados, ratio máximo + return (double) resueltos48h / cerrados; + } + + @Override + public List getAvailableMetrics() { + List metrics = new ArrayList<>(); + metrics.add(M1_NAME); + metrics.add(M2_NAME); + metrics.add(M3_NAME); + return metrics; + } + + @Override + public RemoteType getRemoteType() { + return RemoteType.GITHUB; + } +} \ No newline at end of file diff --git a/src/test/java/us/muit/fs/a4i/test/control/IndicatorStrategyEquipo4Test.java b/src/test/java/us/muit/fs/a4i/test/control/IndicatorStrategyEquipo4Test.java new file mode 100644 index 00000000..ea067c5b --- /dev/null +++ b/src/test/java/us/muit/fs/a4i/test/control/IndicatorStrategyEquipo4Test.java @@ -0,0 +1,72 @@ +package us.muit.fs.a4i.test.control; + +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + +import java.util.Arrays; +import java.util.List; + +import us.muit.fs.a4i.control.IndicatorStrategyEquipo4; +import us.muit.fs.a4i.exceptions.NotAvailableMetricException; +import us.muit.fs.a4i.model.entities.ReportItemI; +import us.muit.fs.a4i.model.entities.impl.SimpleReportItem; + +public class IndicatorStrategyEquipo4Test { + + private final IndicatorStrategyEquipo4 strategy = new IndicatorStrategyEquipo4(); + + @Test + public void testCalcIndicatorCorrectValues() throws NotAvailableMetricException { + List> metrics = Arrays.asList( + new SimpleReportItem("issue_response_time", 0.9), + new SimpleReportItem("issues_without_response_ratio", 0.8), + new SimpleReportItem("resolved_under_48h_ratio", 1.0) + ); + + ReportItemI result = strategy.calcIndicator(metrics); + + assertEquals("issue_management_speed", result.getName()); + assertEquals((0.9 + 0.8 + 1.0) / 3, result.getValue(), 0.0001); + } + + @Test + public void testCalcIndicatorWithZeros() throws NotAvailableMetricException { + List> metrics = Arrays.asList( + new SimpleReportItem("issue_response_time", 0.0), + new SimpleReportItem("issues_without_response_ratio", 0.0), + new SimpleReportItem("resolved_under_48h_ratio", 0.0) + ); + + ReportItemI result = strategy.calcIndicator(metrics); + + assertEquals("issue_management_speed", result.getName()); + assertEquals(0.0, result.getValue(), 0.0001); + } + + @Test + public void testCalcIndicatorWithMaxValues() throws NotAvailableMetricException { + List> metrics = Arrays.asList( + new SimpleReportItem("issue_response_time", 1.0), + new SimpleReportItem("issues_without_response_ratio", 1.0), + new SimpleReportItem("resolved_under_48h_ratio", 1.0) + ); + + ReportItemI result = strategy.calcIndicator(metrics); + + assertEquals("issue_management_speed", result.getName()); + assertEquals(1.0, result.getValue(), 0.0001); + } + + @Test + public void testMissingMetricThrowsException() { + List> metrics = Arrays.asList( + new SimpleReportItem("issue_response_time", 0.9), + new SimpleReportItem("issues_without_response_ratio", 0.8) + // Falta "resolved_under_48h_ratio" + ); + + assertThrows(NotAvailableMetricException.class, () -> { + strategy.calcIndicator(metrics); + }); + } +} \ No newline at end of file diff --git a/src/test/java/us/muit/fs/a4i/test/model/remote/GitHubRemoteEnquirerEquipo4Test.java b/src/test/java/us/muit/fs/a4i/test/model/remote/GitHubRemoteEnquirerEquipo4Test.java new file mode 100644 index 00000000..c1e34c8a --- /dev/null +++ b/src/test/java/us/muit/fs/a4i/test/model/remote/GitHubRemoteEnquirerEquipo4Test.java @@ -0,0 +1,64 @@ +package us.muit.fs.a4i.test.model.remote; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; + +import us.muit.fs.a4i.exceptions.MetricException; +import us.muit.fs.a4i.model.remote.GitHubRemoteEnquirerEquipo4; + +public class GitHubRemoteEnquirerEquipo4Test { + + private static final String TEST_REPO = "MIT-FS/Audit4Improve-API"; + + @Test + public void testConstructorLoadsConfig() { + assertDoesNotThrow(() -> { + GitHubRemoteEnquirerEquipo4 enquirer = new GitHubRemoteEnquirerEquipo4(); + assertNotNull(enquirer); + }); + } + + @Test + public void testGetAvailableMetrics() throws Exception { + GitHubRemoteEnquirerEquipo4 enquirer = new GitHubRemoteEnquirerEquipo4(); + var metrics = enquirer.getAvailableMetrics(); + assertNotNull(metrics); + assertTrue(metrics.contains("issue_response_time")); + assertTrue(metrics.contains("issues_without_response_ratio")); + assertTrue(metrics.contains("resolved_under_48h_ratio")); + // Ya no debe contener "issue_management_speed" + assertFalse(metrics.contains("issue_management_speed")); + } + + @Test + public void testGetMetricValid() throws Exception { + GitHubRemoteEnquirerEquipo4 enquirer = new GitHubRemoteEnquirerEquipo4(); + + var metric = enquirer.getMetric("issue_response_time", TEST_REPO); + assertNotNull(metric); + assertEquals("issue_response_time", metric.getName()); + assertTrue(metric.getValue() instanceof Number); + } + + @Test + public void testGetMetricInvalid() throws Exception { + GitHubRemoteEnquirerEquipo4 enquirer = new GitHubRemoteEnquirerEquipo4(); + + MetricException thrown = assertThrows(MetricException.class, () -> { + enquirer.getMetric("metric_no_existente", TEST_REPO); + }); + + assertTrue(thrown.getMessage().contains("Métrica no soportada")); + } + + @Test + public void testBuildReport() throws Exception { + GitHubRemoteEnquirerEquipo4 enquirer = new GitHubRemoteEnquirerEquipo4(); + var report = enquirer.buildReport(TEST_REPO); + assertNotNull(report); + assertEquals(TEST_REPO, report.getEntityId()); + // Que solo contenga las 3 métricas que quedan + assertEquals(3, report.getAllMetrics().size()); + } +} \ No newline at end of file From 5ceceeb4fbe7b468ad189eb1615b28bddc501132 Mon Sep 17 00:00:00 2001 From: androdfer1 <101417616+andresbasket7@users.noreply.github.com> Date: Mon, 26 May 2025 10:27:52 +0200 Subject: [PATCH 4/4] pruebas.yml --- .github/workflows/pruebas.yml | 45 +++++------------------------------ 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/.github/workflows/pruebas.yml b/.github/workflows/pruebas.yml index 0a60f83f..a9ade09b 100644 --- a/.github/workflows/pruebas.yml +++ b/.github/workflows/pruebas.yml @@ -1,50 +1,17 @@ -name: Flujo de trabajo para ejecutar los test - -on: - workflow_dispatch: - push: - branches: [ V.0.2 ] - pull_request: - branches: [ V.0.2 ] - schedule: - - cron: '1 23 * * 0-4' - jobs: - Build: + build-and-test: runs-on: ubuntu-latest - env: - GITHUB_LOGIN: ${{ github.actor }} - GITHUB_PACKAGES: ${{ secrets.GHTOKEN }} - GITHUB_OAUTH: ${{ secrets.GHTOKEN }} steps: - - name: Clonando el repositorio y estableciendo el espacio de trabajo + - name: Checkout del código uses: actions/checkout@v3 - - name: Configurando java - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '16' - - name: Construyendo el código - run: | - chmod +x gradlew - ./gradlew build - Test: - runs-on: ubuntu-latest - needs: Build - env: - GITHUB_LOGIN: ${{ github.actor }} - GITHUB_PACKAGES: ${{ secrets.GHTOKEN }} - GITHUB_OAUTH: ${{ secrets.GHTOKEN }} - steps: - - name: Clonando el repositorio y estableciendo el espacio de trabajo - uses: actions/checkout@v3 - - name: Configurando java + - name: Configurar Java uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: '16' - - name: Ejecutando los test + + - name: Ejecutar build y test run: | chmod +x gradlew - ./gradlew test + ./gradlew build test \ No newline at end of file