Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Test and Scan

on:
pull_request:
Expand All @@ -18,13 +18,20 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}

- name: Run Unit Tests
run: |
npm ci
npm run test
- name: Run Unit Tests
run: |
npm ci
npm run test:coverage

- name: Sonar Scan
if: matrix.version == 22
uses: SonarSource/sonarqube-scan-action@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ dist/

# Other
*.DS_Store
/coverage
9 changes: 9 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sonar.host.url=https://sonar.tools.sap

sonar.sourceEncoding=UTF-8

sonar.projectKey=cap-js_console
sonar.organization=cap-js

sonar.sources=.
sonar.javascript.lcov.reportPaths=./coverage/lcov.info
2 changes: 1 addition & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
coverage: {
reporter: ['text'],
reporter: ['text', 'lcov'],
include: ['src/**/*.ts'],
},
},
Expand Down
Loading