Does anyone know how to implement Sonarcloud on React Native using Bitbucket Pipeline?
Here’s my bitbucket-pipelines.yml:
image: feeni/node-chrome:latest
# Add extra step to increase the memory limits available on bitbucket pipeline
options:
docker: true
size: 2x
clone:
depth: full # SonarCloud scanner needs the full history to assign issues properly
definitions:
caches:
sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
services:
docker:
memory: 4096
steps:
- step: &build-test-sonarcloud
name: Build, test and analyze on SonarCloud
caches:
- node
- sonar
services:
- docker
script:
- npm install --quiet
# - npm run test -- --code-coverage --no-watch --no-progress --browsers=ChromeHeadlessNoSandbox
- pipe: sonarsource/sonarcloud-scan:1.2.1
- pipe: sonarsource/sonarcloud-quality-gate:0.1.4
variables:
SONAR_TOKEN: ${SONAR_TOKEN}
EXTRA_ARGS: '-Dsonar.source=./ -Dsonar.exclusions=**/*.java, android/** -Dsonar.java.binaries=target/**/*.java -Dsonar.javascript.lcov.reportPaths=coverage/lcov.info'
pipelines:
default:
- step: *build-test-sonarcloud
pull-requests:
'**':
- step: *build-test-sonarcloud
But got this error:
Your project contains .java files, please provide compiled classes with sonar.java.binaries property, or exclude them from the analysis with sonar.exclusions property.