Portals 3435: Add sonarcloud scan to build-test workflow #1604
+26
−26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal of this PR is to add code coverage reporting to sonarcloud scans.
The
build-test.yml
workflow now includes test coverage and a sonarcloud scan for synapse-react-client. It also adds a test coverage script to several package.json files to ensure compatibility with the workflow. The preliminarysonarqube-scan.yml
workflow has been deleted in favor of integrating it with test coverage reporting.In
build-test.yml
, the test job now runs the scripttest:coverage
instead oftest
. For each project with an existing test script,test:coverage
now runs the correspondingjest
orvitest
command with--coverage
to generate a report.The jest and vitest config files now include
lcov
which outputs alcov.info
required for sonarcloud coverage reports.Various package.json files in the
apps
andpackages
directories now includetest:coverage
in addition totest
.Currently, the sonarcloud scan will only run for synapse-react-client. Reports for other projects can be generated by adding them to this file.