From 05b5c5da08c8f9cbe539d768b74b527a6b5a0bf9 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Thu, 2 May 2024 21:27:03 +0200 Subject: [PATCH 1/6] Update build.yml --- .github/workflows/build.yml | 57 ++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 838da9f..6b750d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,30 +23,6 @@ jobs: - name: Build with Maven run: mvn clean verify - - # Mover el reporte de cobertura a la raíz del proyecto - # - name: Move coverage report to project root - # run: | - # mkdir -p coverage - # cp -r SYG-bootstrap/target/site/jacoco-aggregate/jacoco.csv coverage/ - # cp -r SYG-bootstrap/target/site/jacoco-aggregate/index.html coverage/ - - # - name: Configurar Git para el commit - # run: | - # git config --global user.name "AlvaroGlezC" - # git config --global user.email "uo251891@uniovi.es" - - # - name: Hacer commit y push de la cobertura - # run: | - # git add -f coverage - # git commit -m "Agregar reporte de cobertura" - # git push - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: SYG-bootstrap/target/site/jacoco-aggregate/jacoco.xml frontend-tests: runs-on: ubuntu-latest @@ -64,11 +40,32 @@ jobs: - run: npm ci - run: npm test - run: npm run test:coverage + - run: nom run linter - # Si quieres guardar el reporte de cobertura, puedes usar esta sección: - - name: Save coverage report - uses: actions/upload-artifact@v4 + sonarcloudBackend: + name: sonarcloudBackend + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + projectBaseDir: syg-backend/ + + sonarcloudFrontend: + name: sonarcloudFrontend + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage/lcov.info # Ruta al archivo de cobertura - fail_ci_if_error: true + projectBaseDir: syg-frontend/ From 9a917c0672a952c6bb8c1a79024f958879553801 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Thu, 2 May 2024 21:33:35 +0200 Subject: [PATCH 2/6] Update sonar-project.properties --- sonar-project.properties | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 8ce93a6..c71b8d7 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,17 +1,17 @@ -sonar.projectKey=Arquisoft_wiq_es6b -sonar.organization=arquisoft +# sonar.projectKey=Arquisoft_wiq_es6b +# sonar.organization=arquisoft # This is the name and version displayed in the SonarCloud UI. -sonar.projectName=wiq_es6b -sonar.projectVersion=1.0 +# sonar.projectName=wiq_es6b +# sonar.projectVersion=1.0 # Encoding of the source code. Default is default system encoding -sonar.host.url=https://sonarcloud.io -sonar.language=js -sonar.projectName=wiq_es6b +# sonar.host.url=https://sonarcloud.io +# sonar.language=js +# sonar.projectName=wiq_es6b -sonar.coverage.exclusions=**/*.test.js -sonar.sources=webapp/src/components,users/authservice,users/userservice,gatewayservice -sonar.sourceEncoding=UTF-8 -sonar.exclusions=node_modules/** -sonar.javascript.lcov.reportPaths=**/coverage/lcov.info +# sonar.coverage.exclusions=**/*.test.js +# sonar.sources=webapp/src/components,users/authservice,users/userservice,gatewayservice +# sonar.sourceEncoding=UTF-8 +# sonar.exclusions=node_modules/** +# sonar.javascript.lcov.reportPaths=**/coverage/lcov.info From 19a0bbbe486563e08760cf52bbcd730acf97c398 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Thu, 2 May 2024 21:38:44 +0200 Subject: [PATCH 3/6] Create sonar-project.properties --- syg-backend/sonar-project.properties | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 syg-backend/sonar-project.properties diff --git a/syg-backend/sonar-project.properties b/syg-backend/sonar-project.properties new file mode 100644 index 0000000..d4a4301 --- /dev/null +++ b/syg-backend/sonar-project.properties @@ -0,0 +1,10 @@ +sonar.projectKey=Arquisoft_wiq_es6b +sonar.organization=arquisoft + +# This is the name and version displayed in the SonarCloud UI. +sonar.projectName=wiq_es1d +sonar.projectVersion=1.0 + +sonar.language=java +sonar.java.binaries=syg-bootstrap/target/classes +sonar.jacoco.reportPaths=syg-bootstrap/target/site/jacoco-aggregate/jacoco.xml From c95efe7862d6b6c84f0e7a5834b9f27a3271aa20 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Thu, 2 May 2024 21:39:26 +0200 Subject: [PATCH 4/6] Create sonar-project.properties --- syg-frontend/sonar-project.properties | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 syg-frontend/sonar-project.properties diff --git a/syg-frontend/sonar-project.properties b/syg-frontend/sonar-project.properties new file mode 100644 index 0000000..4e542b8 --- /dev/null +++ b/syg-frontend/sonar-project.properties @@ -0,0 +1,9 @@ +sonar.projectKey=Arquisoft_wiq_es6b +sonar.organization=arquisoft + +# This is the name and version displayed in the SonarCloud UI. +sonar.projectName=wiq_es6b +sonar.projectVersion=1.0 + +sonar.sources=src +sonar.javascript.lcov.reportPaths=coverage/lcov.info From 21b7ba08ea30ca7a5d0b1e0bc3f57d76958e7561 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Thu, 2 May 2024 21:48:23 +0200 Subject: [PATCH 5/6] Update build.yml --- .github/workflows/build.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6b750d2..1aca146 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: - run: npm ci - run: npm test - run: npm run test:coverage - - run: nom run linter + - run: nom run lint sonarcloudBackend: name: sonarcloudBackend @@ -48,13 +48,17 @@ jobs: steps: - uses: actions/checkout@v3 with: - fetch-depth: 0 - - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master + fetch-depth: 0 + + # Build and test the project + - name: Build and Test + run: mvn clean install + + # SonarCloud analysis + - name: SonarCloud Analysis + run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - projectBaseDir: syg-backend/ sonarcloudFrontend: name: sonarcloudFrontend From 06069d4d433f2907e378bad814718cc73fd0d4c9 Mon Sep 17 00:00:00 2001 From: AGC <158510532+AlvaroGlezC@users.noreply.github.com> Date: Thu, 2 May 2024 22:11:49 +0200 Subject: [PATCH 6/6] Update build.yml --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1aca146..3e91fe5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,11 +40,14 @@ jobs: - run: npm ci - run: npm test - run: npm run test:coverage - - run: nom run lint + - run: npm run lint sonarcloudBackend: name: sonarcloudBackend runs-on: ubuntu-latest + defaults: + run: + working-directory: syg-backend steps: - uses: actions/checkout@v3 with: