Skip to content

Commit

Permalink
feat: add SonarCloud implementation (#15)
Browse files Browse the repository at this point in the history
* edit release badge

* edit link

* edit image + link

* add .gitignore file

* add PR Title Linter

* test

* test

* add status badge for PR Linter

* add SonarCloud implementation
  • Loading branch information
meleksabit authored Nov 28, 2024
1 parent c7099d7 commit 64d462a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: SonarCloud Analysis

on:
# Trigger analysis when pushing to your main branches, and when creating a pull request.
push:
branches:
- main
- dev
pull_request:
types: [opened, synchronize, reopened]

jobs:
sonar-scan:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
java-package: 'jdk'

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@v3 # Ex: v2.1.0, See the latest version at https://github.com/marketplace/actions/sonarcloud-scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
10 changes: 10 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Required project settings
sonar.organization=meleksabit
sonar.projectKey=meleksabit_drones-html-css
sonar.projectName=drones-html-css
sonar.host.url=https://sonarcloud.io

# Optional configuration
sonar.sources=.
sonar.language=html # (or your project's primary language)
sonar.sourceEncoding=UTF-8

0 comments on commit 64d462a

Please sign in to comment.