Skip to content

[_]: feat/centralize auth and rate limit #1083

[_]: feat/centralize auth and rate limit

[_]: feat/centralize auth and rate limit #1083

name: SonarCloud code analysis
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
environment: test
strategy:
matrix:
node-version: [22.12.0]
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 ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://npm.pkg.github.com"
- run: echo NODE_ENV=test >> ./.env
- run: echo SERVER_PORT=8000 >> ./.env
- run: echo STRIPE_SECRET_KEY=${{ secrets.STRIPE_SECRET_KEY }} >> ./.env
- run: echo JWT_SECRET=JWT_SECRET >> ./.env
- run: echo CRYPTO_PAYMENTS_PROCESSOR_SECRET_KEY=secret >> ./.env
- run: echo CRYPTO_PAYMENTS_PROCESSOR_API_KEY=api-key >> ./.env
- run: echo CRYPTO_PAYMENTS_PROCESSOR_API_URL=url >> ./.env
- run: echo DRIVE_NEW_GATEWAY_SECRET=secret >> ./.env
- run: echo DRIVE_NEW_GATEWAY_URL=http://localhost:8003 >> ./.env
- run: echo CHART_API_URL=api_url >> ./.env
- run: echo PAYMENTS_GATEWAY_SECRET=${{secrets.PAYMENTS_GATEWAY_SECRET}} >> ./.env
- run: echo PAYMENTS_GATEWAY_PUBLIC_SECRET=${{secrets.PAYMENTS_GATEWAY_PUBLIC_SECRET}} >> ./.env
- run: echo PC_CLOUD_TRIAL_CODE=my_code >> ./.env
- run: echo "registry=https://registry.yarnpkg.com/" > .npmrc
- run: echo "@internxt:registry=https://npm.pkg.github.com" >> .npmrc
# You cannot read packages from other private repos with GITHUB_TOKEN
# You have to use a PAT instead https://github.com/actions/setup-node/issues/49
- run: echo //npm.pkg.github.com/:_authToken=${{ secrets.PERSONAL_ACCESS_TOKEN }} >> .npmrc
- run: echo "always-auth=true" >> .npmrc
- name: Install dependencies
run: yarn
- name: Test and coverage
run: yarn test:cov
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}