Merge pull request #425 from internxt/dependabot-npm_and_yarn-multi-3… #871
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: SonarCloud analysis | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| pull-requests: read # allows SonarCloud to decorate PRs with analysis results | |
| jobs: | |
| Analysis: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22.x' | |
| cache: yarn | |
| - name: Add .env | |
| run: cp .env.template .env | |
| - name: Add .npmrc | |
| run: cp .npmrc.template .npmrc | |
| - run: yarn | |
| - run: yarn build | |
| - run: yarn test:unit | |
| # Analyze with SonarCloud | |
| - name: Analyze with SonarCloud | |
| uses: SonarSource/sonarqube-scan-action@master | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Generate a token on Sonarcloud.io, add it to the secrets of this repo with the name SONAR_TOKEN (Settings > Secrets > Actions > add new repository secret) |