Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/actions/sonarcloud/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: sonarcloud
description: SonarCloud Scan action
inputs:
sonar-token:
description: sonarToken
required: true

runs:
using: composite
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@v4.2.0
env:
SONAR_TOKEN: ${{inputs.sonar-token}}
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:
branches:
- main
pull_request:

permissions:
id-token: write
contents: read

jobs:
quality:
name: Quality
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Sonarcloud Scan
uses: ./.github/actions/sonarcloud
with:
sonar-token: ${{ secrets.SONAR_TOKEN }}
23 changes: 23 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# must be unique in a given SonarQube instance
sonar.projectKey=AlexByte18_artisan-api
sonar.organization=artisan

# --- optional properties ---
sonar.javascript.lcov.reportPaths=**/coverage/**/lcov.info
sonar.scm.exclusions.disabled=true
sonar.scm.forceReloadAll=true

# Path is relative to the sonar-project.properties file. Defaults to .
sonar.sources=.

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
sonar.inclusions=**/*.ts,**/*.tsx,**/*.js,**/*.jsx,**/*.tf
sonar.exclusions=**/testHelpers/**/*,**/__tests__/**/*,**/mock*.ts,**/__mocks__/**/*
sonar.typescript.file.suffixes=.ts,.tsx

# Coverage exclusions for specific files or folders
# Excluding artisan-api from coverage temporarily
sonar.coverage.exclusions=components/artisan-api/src/__service_tests__/**/*,components/artisan-api/src/testHelpers/**/*,components/artisan-api/scripts/**/*,components/artisan-api/**/handler.ts,components/artisan-api/src/resources/Profiles/dev-assets/index.ts
sonar.tests=.
sonar.test.inclusions=**/*.test.tsx,**/*.test.ts,**/testHelpers/**/*,**/__tests__/**/*,**/mock*.ts