diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index 0e41bfd1e..97eb7de80 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -64,16 +64,25 @@ generate coverage html: needs: - job: run go tests +run jest tests: + stage: test + image: sonarsource/sonar-scanner-cli:latest + script: + - npm install + - npm test -- --coverage --testResultsProcessor=jest-sonar-reporter + - sonar-scanner + upload to sonarcloud: stage: test image: sonarsource/sonar-scanner-cli:4.6 variables: SONAR_TOKEN: $SONAR_TOKEN script: - - sonar-scanner -Dsonar.projectKey=molecula_featurebase -Dsonar.organization=molecula -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.go.coverage.reportPaths=coverage.out -Dsonar.go.tests.reportPaths=test-report.out + - sonar-scanner -Dsonar.projectKey=molecula_featurebase -Dsonar.organization=molecula -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.go.coverage.reportPaths=coverage.out -Dsonar.go.tests.reportPaths=test-report.out -Dsonar.testExecutionReportPaths=test-report.xml needs: - job: run go tests - job: run go tests with output + - job: run jest tests build for linux amd64: stage: build @@ -121,4 +130,4 @@ build for darwin arm64: - go build -o featurebase_darwin_arm64 ./cmd/featurebase artifacts: paths: - - featurebase_darwin_arm64 \ No newline at end of file + - featurebase_darwin_arm64 diff --git a/lattice/package.json b/lattice/package.json index e50cc0bdb..48785d4c7 100644 --- a/lattice/package.json +++ b/lattice/package.json @@ -44,6 +44,7 @@ "@types/react-dom": "^16.9.8", "@types/react-router": "^5.1.8", "@types/react-router-dom": "^5.1.5", + "jest-sonar-reporter": "^2.0.0", "node-sass": "^4.14.1", "react-scripts": "^4.0.3", "tslint": "^6.1.2",