Skip to content

Commit a7188ca

Browse files
committed
Report tests result to sonarqube
1 parent 6f97462 commit a7188ca

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

.github/workflows/CI.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
branches: [master]
88
schedule:
99
- cron: 0 0 * * 0
10+
permissions:
11+
contents: read
12+
actions: read
13+
checks: write
1014

1115
jobs:
1216
lint:
@@ -73,16 +77,20 @@ jobs:
7377
- name: Install ESLint ${{ matrix.eslint }} and TypeScript-ESLint ${{ matrix.typescript-eslint }}
7478
run: npm install --force --no-save eslint@${{ matrix.eslint }} @typescript-eslint/eslint-plugin@${{ matrix.typescript-eslint }}
7579
- name: Test
76-
run: npm run -s test:ci:${{ matrix.eslint }} -- --reporter json --reporter-options output=reports/tests.json
80+
run: npm run -s test:ci:${{ matrix.eslint }} -- --reporter xunit --reporter-options output=reports/tests.xml
7781
- name: Test Report
7882
uses: dorny/test-reporter@v1
7983
if: success() || failure()
8084
with:
8185
name: Tests Results (${{ matrix.eslint }}, ${{ matrix.node }}, ${{ matrix.os }})
82-
path: reports/tests.json
83-
reporter: mocha-json
86+
path: reports/tests.xml
87+
reporter: swift-xunit
8488
- name: Send Coverage
8589
uses: codecov/codecov-action@v3
8690
with:
8791
token: "${{ secrets.CODECOV_TOKEN }}"
8892
directory: ./coverage/
93+
- name: SonarQube Scan
94+
uses: SonarSource/sonarqube-scan-action@v4
95+
env:
96+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

sonar-project.properties

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
sonar.projectKey=ben12_eslint-plugin-dprint
2+
sonar.organization=ben12
3+
sonar.projectName=ESLint Plugin Dprint
4+
5+
sonar.tests=test
6+
sonar.exclusions=node_modules/**, dist/**, reports/**, coverage/**
7+
8+
sonar.javascript.lcov.reportPaths=coverage/lcov.info
9+
sonar.cs.xunit.reportsPaths=reports/tests.xml
10+
11+
sonar.cpd.exclusions=test/**/*

0 commit comments

Comments
 (0)