Skip to content

Commit

Permalink
Report tests result to sonarqube
Browse files Browse the repository at this point in the history
  • Loading branch information
ben12 committed Dec 22, 2024
1 parent 6f97462 commit 1f1cb57
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
branches: [master]
schedule:
- cron: 0 0 * * 0
permissions:
contents: read
actions: read
checks: write

jobs:
lint:
Expand Down Expand Up @@ -73,16 +77,20 @@ jobs:
- name: Install ESLint ${{ matrix.eslint }} and TypeScript-ESLint ${{ matrix.typescript-eslint }}
run: npm install --force --no-save eslint@${{ matrix.eslint }} @typescript-eslint/eslint-plugin@${{ matrix.typescript-eslint }}
- name: Test
run: npm run -s test:ci:${{ matrix.eslint }} -- --reporter json --reporter-options output=reports/tests.json
run: npm run -s test:ci:${{ matrix.eslint }} -- --reporter xunit --reporter-options output=reports/tests.xml
- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: Tests Results (${{ matrix.eslint }}, ${{ matrix.node }}, ${{ matrix.os }})
path: reports/tests.json
reporter: mocha-json
path: reports/tests.xml
reporter: swift-xunit
- name: Send Coverage
uses: codecov/codecov-action@v3
with:
token: "${{ secrets.CODECOV_TOKEN }}"
directory: ./coverage/
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
11 changes: 11 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sonar.projectKey=ben12_eslint-plugin-dprint
sonar.projectName=ESLint Plugin Dprint
sonar.token=${SONAR_TOKEN}

sonar.tests=test
sonar.exclusions=node_modules/**, dist/**, reports/**, coverage/**

sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.cs.xunit.reportsPaths=reports/tests.xml

sonar.cpd.exclusions=test/**/*

0 comments on commit 1f1cb57

Please sign in to comment.