Skip to content

release actions sonar #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
28 changes: 28 additions & 0 deletions .github/workflow/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: 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.6d0af32090dcf592f4068d5ecfef544015afa7fb }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.6d0af32090dcf592f4068d5ecfef544015afa7fb }}
addons:
sonarcloud:
organization: "pedropbazzo"
token:
secure: "5a9285b637a4a72997ec008770791ccdb9ea186f" # encrypted value of your token

script:
- ./gradlew sonarqube
File renamed without changes.
12 changes: 12 additions & 0 deletions .github/workflow/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sonar.projectKey=pedropbazzo_graphql-java-demo
sonar.organization=pedropbazzo

# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=graphql-java-demo
#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
9 changes: 9 additions & 0 deletions .github/workflow/travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
addons:
sonarcloud:
organization: "pedropbazzo"
token:
secure: "5a9285b637a4a72997ec008770791ccdb9ea186f" # encrypted value of your token

script:
# the following command line builds the project, runs the tests with coverage and then execute the SonarCloud analysis
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.projectKey=pedropbazzo_graphql-java-demo
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

[![Build Status](https://travis-ci.com/npalm/graphql-java-demo.svg?branch=master)](https://travis-ci.com/npalm/graphql-java-demo)
[![Maintainability](https://api.codeclimate.com/v1/badges/f569acb75ecae1cff403/maintainability)](https://codeclimate.com/github/npalm/graphql-java-demo/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/f569acb75ecae1cff403/test_coverage)](https://codeclimate.com/github/npalm/graphql-java-demo/test_coverage)
Expand Down