Skip to content

Commit 4944725

Browse files
committed
ci: add sonarqube action
1 parent a2d2c7e commit 4944725

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

.github/workflows/ci.workflow.yml

+21-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
ci-bazel-tests:
10-
name:
10+
name: Bazel Tests
1111
runs-on: ubuntu-latest
1212

1313
steps:
@@ -17,10 +17,29 @@ jobs:
1717
- name: Setup Bazelisk
1818
uses: bazel-contrib/setup-bazel@0.14.0
1919
with:
20-
bazelisk-version: 1.25.0
2120
bazelisk-cache: true
2221
repository-cache: true
2322

2423
- name: Run Bazel Tests
2524
run: |
2625
bazelisk test //... --test_output=all --test_verbose_timeout_warnings --test_arg=--verbose --test_arg=--coverage
26+
27+
ci-sonarqube-scan:
28+
name: SonarQube
29+
needs: ci-bazel-tests
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- name: Checkout Repository
34+
uses: actions/checkout@v4
35+
36+
- name: Setup Bazelisk
37+
uses: bazel-contrib/setup-bazel@0.14.0
38+
with:
39+
bazelisk-cache: true
40+
repository-cache: true
41+
42+
- name: SonarQube Scan
43+
uses: SonarSource/sonarqube-scan-action@v4.2.1
44+
env:
45+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

sonar-project.properties

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
sonar.projectName=Bazel Monorepo
2+
sonar.projectKey=bazel-monorepo
3+
sonar.organization=richhh7g
4+
5+
sonar.sources = apps/js-legacy-api-items/src, apps/js-api-items/src
6+
sonar.exclusions=**/node_modules/**, **/*.test.js, **/index.js
7+
8+
sonar.tests = apps/js-legacy-api-items, apps/js-api-items
9+
sonar.test.inclusions=**/*.test.js
10+
11+
sonar.javascript.lcov.reportPaths=.bazel/out/k8-fastbuild/testlogs/apps/js-api-items/test/coverage.dat, .bazel/out/k8-fastbuild/testlogs/apps/js-legacy-api-items/test/coverage.dat

0 commit comments

Comments
 (0)