diff --git a/.github/workflows/fe-sonar.yml b/.github/workflows/fe-sonar.yml index 625f80b..3382b1a 100644 --- a/.github/workflows/fe-sonar.yml +++ b/.github/workflows/fe-sonar.yml @@ -7,6 +7,9 @@ on: SONAR_CLOUD_TOKEN: required: true description: "SonarCloud authentication token" + DOT_NPMRC: + required: true + description: "Npm token" inputs: SONAR_CLOUD_ORG: required: false @@ -29,7 +32,7 @@ jobs: name: SonarQube Code Quality Scan runs-on: ${{ inputs.GITHUB_RUNNER }} # Only run the workflow for master/main and release branches - if: github.ref_name == 'master' || github.ref_name == 'main' || startsWith(github.ref_name, 'release/') + #if: github.ref_name == 'master' || github.ref_name == 'main' || startsWith(github.ref_name, 'release/') permissions: contents: read steps: @@ -49,7 +52,14 @@ jobs: with: path: '**/node_modules' key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }} - + + - name: Use .npmrc + if: steps.npm-cache.outputs.cache-hit != 'true' + id: use-npmrc + uses: bduff9/use-npmrc@v1.2 + with: + dot-npmrc: ${{ secrets.DOT_NPMRC }} + - name: Install dependencies if: steps.npm-cache.outputs.cache-hit != 'true' run: npm ci @@ -61,7 +71,7 @@ jobs: run: npx nx run-many --target=lint --all --parallel --configuration=dev - name: Run Unit Tests with Coverage - run: npx nx run-many --target=test --all --parallel --coverage --codeCoverage=true --coverageReporters=lcov --coverageReporters=html + run: npx nx run-many --target=test --all --parallel=false --coverage --codeCoverage=true --coverageReporters=lcov --coverageReporters=html continue-on-error: false - name: Check for LCOV files @@ -115,7 +125,7 @@ jobs: echo "=== SonarQube Configuration ===" cat sonar-project.properties - - name: SonarQube Scan - uses: SonarSource/sonarqube-scan-action@v6 - env: - SONAR_TOKEN: ${{ secrets.SONAR_CLOUD_TOKEN }} +# - name: SonarQube Scan +# uses: SonarSource/sonarqube-scan-action@v6 +# env: +# SONAR_TOKEN: ${{ secrets.SONAR_CLOUD_TOKEN }}