Skip to content

Commit 5be8420

Browse files
committed
SonarCloud
1 parent 814a690 commit 5be8420

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

.github/workflows/test.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
1618
- name: Setup .NET
1719
uses: actions/setup-dotnet@v4
1820
with:
@@ -25,7 +27,12 @@ jobs:
2527
- name: Install Dependencies
2628
run: npm ci
2729
- name: Run Jest Tests
28-
run: npm run ci-test
30+
run: npm run ci-test --coverage
31+
- name: SonarQube Scan
32+
uses: SonarSource/sonarqube-scan-action@v4
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
35+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2936

3037
test-action:
3138
name: GitHub Actions Test

__tests__/e2e.test.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// tests/e2e.test.ts
2-
31
import * as github from '@actions/github';
42
import fs from 'fs';
53
import path from 'path';

sonar-project.properties

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
sonar.projectKey=na1307_blazor-github-pages
2+
sonar.organization=na1307
3+
sonar.javascript.lcov.reportPaths=./coverage/lcov.info
4+
5+
# This is the name and version displayed in the SonarCloud UI.
6+
#sonar.projectName=blazor-github-pages
7+
#sonar.projectVersion=1.0
8+
9+
10+
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
11+
#sonar.sources=.
12+
13+
# Encoding of the source code. Default is default system encoding
14+
#sonar.sourceEncoding=UTF-8

0 commit comments

Comments
 (0)