Skip to content

Commit

Permalink
change sonarqube
Browse files Browse the repository at this point in the history
  • Loading branch information
Pikay93 committed Feb 5, 2024
1 parent 4a401db commit 26ae694
Showing 1 changed file with 15 additions and 26 deletions.
41 changes: 15 additions & 26 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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

0 comments on commit 26ae694

Please sign in to comment.