Skip to content

Commit f6d9b8f

Browse files
ci: configure sonarcube
1 parent e9f63bd commit f6d9b8f

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,40 @@ jobs:
2828
- name: Run tests
2929
run: npm run test
3030

31+
- uses: actions/upload-artifact@master
32+
with:
33+
name: coverage-lcov
34+
path: coverage
35+
3136
- name: Release
3237
env:
3338
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3439
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3540
run: npx semantic-release
41+
42+
sonarcube:
43+
name: Sonarcube
44+
runs-on: ubuntu-18.04
45+
needs: release
46+
47+
steps:
48+
- uses: actions/checkout@v2
49+
with:
50+
fetch-depth: 0
51+
52+
- uses: actions/download-artifact@master
53+
with:
54+
name: coverage-lcov
55+
path: coverage
56+
57+
- name: Get npm package version
58+
id: package-version
59+
uses: Saionaro/[email protected]
60+
61+
- uses: sonarsource/sonarqube-scan-action@master
62+
env:
63+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
64+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
65+
with:
66+
args: >
67+
-Dsonar.projectVersion=${{ steps.package-version.outputs.version }}

sonar-project.properties

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
sonar.projectKey=Lomray-Software_microservice-nodejs
1+
sonar.projectKey=Lomray-Software_microservice-nodejs-lib
2+
sonar.sources=src
3+
sonar.tests=__tests__
4+
sonar.javascript.lcov.reportPaths=coverage/lcov.info
5+
6+
# =====================================================
7+
# Meta-data for the project
8+
# =====================================================
9+
10+
sonar.links.homepage=https://github.com/Lomray-Software/microservice-nodejs-lib
11+
sonar.links.ci=https://github.com/Lomray-Software/microservice-nodejs-lib/actions
12+
sonar.links.issue=https://github.com/Lomray-Software/microservice-nodejs-lib/issues

0 commit comments

Comments
 (0)