Skip to content

Commit

Permalink
sonarcloud integration
Browse files Browse the repository at this point in the history
  • Loading branch information
bilalcaliskan committed Nov 23, 2021
1 parent b4d3d44 commit dcd9760
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
name: PR
on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
lint:
Expand Down Expand Up @@ -78,13 +79,26 @@ jobs:
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

build:
needs:
- lint
- vet
- ineffassign
- test
- codeql
- sonarcloud
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,28 @@ jobs:
- name: Coverage Upload
run: bash <(curl -s https://codecov.io/bash)

sonarcloud:
runs-on: ubuntu-latest
needs:
- lint
- vet
- ineffassign
- test
- codeql
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

build:
needs:
- coverage
- sonarcloud
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![CI](https://github.com/bilalcaliskan/syn-flood/workflows/CI/badge.svg?event=push)](https://github.com/bilalcaliskan/syn-flood/actions?query=workflow%3ACI)
[![Docker pulls](https://img.shields.io/docker/pulls/bilalcaliskan/syn-flood)](https://hub.docker.com/r/bilalcaliskan/syn-flood/)
[![Go Report Card](https://goreportcard.com/badge/github.com/bilalcaliskan/syn-flood)](https://goreportcard.com/report/github.com/bilalcaliskan/syn-flood)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=bilalcaliskan_syn-flood&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=bilalcaliskan_syn-flood)
[![codecov](https://codecov.io/gh/bilalcaliskan/syn-flood/branch/master/graph/badge.svg)](https://codecov.io/gh/bilalcaliskan/syn-flood)
[![Release](https://img.shields.io/github/release/bilalcaliskan/syn-flood.svg)](https://github.com/bilalcaliskan/syn-flood/releases/latest)
[![Go version](https://img.shields.io/github/go-mod/go-version/bilalcaliskan/syn-flood)](https://github.com/bilalcaliskan/syn-flood)
Expand Down
12 changes: 12 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sonar.projectKey=bilalcaliskan_syn-flood
sonar.organization=bilalcaliskan-github

# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=syn-flood
#sonar.projectVersion=1.0

# 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

0 comments on commit dcd9760

Please sign in to comment.