Skip to content

Commit

Permalink
chore: update sonar settings
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Sep 11, 2024
1 parent 32dbdbf commit eca8d41
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 19 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ updates:
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
44 changes: 37 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: npm
- name: Build & test
run: |
npm ci
npm run build
xvfb-run --auto-servernum npm test

- name: install
run: npm ci

- name: build
run: npm run build

- name: test
run: xvfb-run --auto-servernum npm test
shell: bash

- name: cache coverage reports
uses: actions/cache/save@v4
with:
path: |
coverage/chrome/lcov.info
coverage/firefox/lcov.info
key: coverage

sonar:
runs-on: ubuntu-latest
needs: [ci]
Expand All @@ -31,9 +43,27 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis (SonarCloud)
- uses: actions/setup-node@v3

- uses: actions/setup-node@v4
with:
cache: npm

- name: Restore coverage from cache
uses: actions/cache/restore@v4
with:
path: |
coverage/chrome/lcov.info
coverage/firefox/lcov.info
key: coverage
restore-keys: coverage

- name: Read package version
id: package-version
uses: martinbeentjes/[email protected]

- name: Set version
run: echo -e "\nsonar.projectVersion=${{ steps.package-version.outputs.current-version}}" >> sonar-project.properties

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: npm
registry-url: https://registry.npmjs.org/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
if: github.repository_owner == 'kurkle'
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 3 additions & 10 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@ sonar.projectKey=kurkle_chartjs-chart-treemap
sonar.organization=kurkle

# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=chartjs-chart-treemap
#sonar.projectVersion=1.0
sonar.projectName=chartjs-chart-treemap

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
#sonar.sources=.

# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
sonar.sources=src/
sonar.tests=test/

sonar.javascript.lcov.reportPaths=coverage/chrome/lcov.info,coverage/firefox/lcov.info

sonar.coverage.exclusions=**/test/**, **/types/**, **/*.config.js, **/*.conf.js, **/*.conf.cjs, **/docs/**

sonar.cpd.exclusions=**/test/**, **/docs/**

0 comments on commit eca8d41

Please sign in to comment.