Add SonarQube CI workflow and project configs #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: SonarQube Analysis | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - 'feature/**' | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| sonarqube-backend: | |
| name: SonarQube Backend Analysis | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - name: SonarQube Scan - Backend | |
| uses: SonarSource/sonarqube-scan-action@v2 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }} | |
| SONAR_HOST_URL: https://sonarcloud.io | |
| with: | |
| projectBaseDir: . | |
| args: > | |
| -Dsonar.projectKey=omics-datascience_multiomix-backend | |
| -Dsonar.organization=omics-datascience | |
| sonarqube-frontend: | |
| name: SonarQube Frontend Analysis | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '20.x' | |
| - name: Install dependencies | |
| run: npm --prefix src/frontend/static/frontend install | |
| - name: Run linter and type checks | |
| run: npm --prefix src/frontend/static/frontend run check-all | |
| - name: SonarQube Scan - Frontend | |
| uses: SonarSource/sonarqube-scan-action@v2 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FRONTEND }} | |
| SONAR_HOST_URL: https://sonarcloud.io | |
| with: | |
| projectBaseDir: src/frontend/static/frontend | |
| args: > | |
| -Dsonar.projectKey=omics-datascience_multiomix-frontend | |
| -Dsonar.organization=omics-datascience |