Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INTERNAL] Add SonarCloud to check for code coverage and other quality reports #357

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
110 changes: 105 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ on:
branches: [ main ]

jobs:
build:

ci:
strategy:
matrix:
node-version: [14.x, 16.x, 18.x, 19.x]
node-version: [14, 16, 18, latest]
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -24,3 +21,106 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test

# run sonarcloud analysis once for all packages
qa:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use latest Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- run: npm install
- run: npm test
- name: Analyze @testdeck/core with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: packages/core
args: >
-Dsonar.organization=testdeck
-Dsonar.projectKey=testdeck_core
-Dsonar.sources=index.ts
-Dsonar.test.exclusions=test.ts
-Dsonar.tests=test.ts
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.verbose=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Analyze @testdeck/mocha with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: packages/mocha
args: >
-Dsonar.organization=testdeck
-Dsonar.projectKey=testdeck_mocha
-Dsonar.sources=index.ts
-Dsonar.test.exclusions=test.ts
-Dsonar.tests=test.ts
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.verbose=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Analyze @testdeck/jest with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: packages/jest
args: >
-Dsonar.organization=testdeck
-Dsonar.projectKey=testdeck_jest
-Dsonar.sources=index.ts
-Dsonar.test.exclusions=test.ts
-Dsonar.tests=test.ts
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.verbose=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Analyze @testdeck/jasmine with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: packages/jasmine
args: >
-Dsonar.organization=testdeck
-Dsonar.projectKey=testdeck_jasmine
-Dsonar.sources=index.ts
-Dsonar.test.exclusions=test.ts
-Dsonar.tests=test.ts
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.verbose=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# TODO vitest coverage report
# -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
- name: Analyze @testdeck/vitest with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: packages/vitest
args: >
-Dsonar.organization=testdeck
-Dsonar.projectKey=testdeck_vitest
-Dsonar.sources=index.ts
-Dsonar.test.exclusions=test.ts
-Dsonar.tests=test.ts
-Dsonar.verbose=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Analyze @testdeck/di-typedi with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: packages/di-typedi
args: >
-Dsonar.organization=testdeck
-Dsonar.projectKey=testdeck_di_typedi
-Dsonar.sources=index.ts
-Dsonar.test.exclusions=test.ts
-Dsonar.tests=test.ts
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.verbose=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}