This commit is contained in:
@@ -45,7 +45,32 @@ steps:
|
||||
- npx nx run-many --target=build --projects="$PROJECTS"
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 3. Determine the version and npm dist-tag, then publish every project.
|
||||
# 3. Run tests and collect coverage for SonarQube
|
||||
# -------------------------------------------------------------------------
|
||||
- name: test
|
||||
image: *node_image
|
||||
environment:
|
||||
PUBLISH_PROJECTS: *default_projects
|
||||
commands:
|
||||
- PROJECTS="${PUBLISH_PROJECTS:-reviews-stars}"
|
||||
- npx nx run-many -t test --code-coverage --passWithNoTests --projects="$PROJECTS"
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 4. SonarQube analysis (runs against the tag/branch being released)
|
||||
# -------------------------------------------------------------------------
|
||||
- name: sonar
|
||||
image: sonarsource/sonar-scanner-cli:latest
|
||||
environment:
|
||||
SONAR_HOST_URL:
|
||||
from_secret: SONAR_HOST_URL
|
||||
SONAR_TOKEN:
|
||||
from_secret: SONAR_TOKEN
|
||||
commands:
|
||||
- sonar-scanner
|
||||
-Dsonar.projectVersion=${CI_COMMIT_TAG#v}
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 5. Determine the version and npm dist-tag, then publish every project.
|
||||
#
|
||||
# For tag events : version is derived from the tag (strips leading "v").
|
||||
# For manual runs : VERSION env-var must be supplied via the Woodpecker
|
||||
|
||||
@@ -27,3 +27,16 @@ steps:
|
||||
image: node:22
|
||||
commands:
|
||||
- npx nx run-many -t test --code-coverage --passWithNoTests --projects="reviews-stars"
|
||||
|
||||
- name: sonar
|
||||
image: sonarsource/sonar-scanner-cli:latest
|
||||
environment:
|
||||
SONAR_HOST_URL:
|
||||
from_secret: SONAR_HOST_URL
|
||||
SONAR_TOKEN:
|
||||
from_secret: SONAR_TOKEN
|
||||
commands:
|
||||
- sonar-scanner
|
||||
-Dsonar.pullrequest.key=${CI_COMMIT_PULL_REQUEST}
|
||||
-Dsonar.pullrequest.branch=${CI_COMMIT_SOURCE_BRANCH}
|
||||
-Dsonar.pullrequest.base=${CI_COMMIT_TARGET_BRANCH}
|
||||
|
||||
Reference in New Issue
Block a user