diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 838da9f..3e91fe5 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,39 @@ jobs: - run: npm ci - run: npm test - run: npm run test:coverage + - run: npm run lint + + sonarcloudBackend: + name: sonarcloudBackend + runs-on: ubuntu-latest + defaults: + run: + working-directory: syg-backend + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # Build and test the project + - name: Build and Test + run: mvn clean install - # Si quieres guardar el reporte de cobertura, puedes usar esta sección: - - name: Save coverage report - uses: actions/upload-artifact@v4 + # SonarCloud analysis + - name: SonarCloud Analysis + run: mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + 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/ 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 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 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