fix(ci): use native sonar-scanner CLI instead of npm wrapper
All checks were successful
Build & Publish / publish (push) Successful in 1m11s
All checks were successful
Build & Publish / publish (push) Successful in 1m11s
The npm sonarqube-scanner bootstrapper was ignoring the host URL and defaulting to sonarcloud.io. Switch to the official sonar-scanner-cli binary which respects -D flags directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,21 +8,32 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
sonarqube:
|
sonarqube:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
|
||||||
image: node:22-bookworm-slim
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Run tests with coverage
|
- name: Run tests with coverage
|
||||||
run: npx vitest run --exclude 'e2e/**' --coverage --coverage.reporter=lcov
|
run: npx vitest run --exclude 'e2e/**' --coverage --coverage.reporter=lcov
|
||||||
|
|
||||||
- name: Install SonarQube scanner
|
- uses: actions/setup-java@v4
|
||||||
run: npm install -g sonarqube-scanner
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 17
|
||||||
|
|
||||||
|
- name: Install sonar-scanner
|
||||||
|
run: |
|
||||||
|
SONAR_SCANNER_VERSION=6.2.1.4610
|
||||||
|
curl -sSLo sonar-scanner.zip "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux-x64.zip"
|
||||||
|
unzip -q sonar-scanner.zip
|
||||||
|
echo "$PWD/sonar-scanner-${SONAR_SCANNER_VERSION}-linux-x64/bin" >> "$GITHUB_PATH"
|
||||||
|
|
||||||
- name: Run SonarQube analysis
|
- name: Run SonarQube analysis
|
||||||
env:
|
env:
|
||||||
@@ -31,7 +42,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sonar-scanner \
|
sonar-scanner \
|
||||||
-Dsonar.host.url="$SONAR_HOST_URL" \
|
-Dsonar.host.url="$SONAR_HOST_URL" \
|
||||||
-Dsonar.token="$SONAR_TOKEN" \
|
-Dsonar.login="$SONAR_TOKEN" \
|
||||||
-Dsonar.projectKey=cameleer-design-system \
|
-Dsonar.projectKey=cameleer-design-system \
|
||||||
-Dsonar.projectName="Cameleer Design System" \
|
-Dsonar.projectName="Cameleer Design System" \
|
||||||
-Dsonar.sources=src/design-system \
|
-Dsonar.sources=src/design-system \
|
||||||
|
|||||||
Reference in New Issue
Block a user