From 26ae6946b5fb96aaa327f0fd945aef0f82c54303 Mon Sep 17 00:00:00 2001 From: Prathees Kumaravel Date: Mon, 5 Feb 2024 20:38:28 +0000 Subject: [PATCH] change sonarqube --- .github/workflows/sonarqube.yml | 41 ++++++++++++--------------------- 1 file changed, 15 insertions(+), 26 deletions(-) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index 13a3ce4f..903a631e 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -46,33 +46,22 @@ jobs: ports: - 27017:27017 + strategy: + matrix: + node-version: [14.x] + steps: - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 with: - # Disabling shallow clone is recommended for improving relevancy of reporting - fetch-depth: 0 - - name: Analyze with SonarQube - - # You can pin the exact commit or the version. - # uses: SonarSource/sonarqube-scan-action@v1.1.0 - uses: SonarSource/sonarqube-scan-action@7295e71c9583053f5bf40e9d4068a0c974603ec8 + node-version: ${{ matrix.node-version }} + - run: npm install + working-directory: backend + - run: npm install --save-dev nyc + working-directory: backend + - run: npm test + working-directory: backend env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on SonarQube, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret) - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - SONAR_ROOT_CERT: ${{ vars.SONAR_ROOT_CERT }} - with: - # Additional arguments for the sonarcloud scanner - args: - # Unique key of your project. You can find it in SonarQube > [my project] > Project Information (top-right menu) - # mandatory - -Dsonar.projectKey=todo_pk_SQ - -Dsonar.verbose=true - # Comma-separated paths to directories containing main source files. - #-Dsonar.sources= # optional, default is project base directory - # When you need the analysis to take place in a directory other than the one from which it was launched - #-Dsonar.projectBaseDir= # optional, default is . - # Comma-separated paths to directories containing test source files. - #-Dsonar.tests= # optional. For more info about Code Coverage, please refer to https://docs.sonarcloud.io/enriching/test-coverage/overview/ - # Adds more detail to both client and server-side analysis logs, activating DEBUG mode for the scanner, and adding client-side environment variables and system properties to the server-side log of analysis report processing. - #-Dsonar.verbose= # optional, default is false + CI: true + MONGODB_URI: mongodb://localhost:27017/test \ No newline at end of file