Skip to content

Commit

Permalink
Test SC GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
jules.vinot authored and jules.vinot committed May 22, 2024
1 parent 3f03b6a commit ca73028
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 28 deletions.
35 changes: 7 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,20 @@
name: Build

on:
push:
branches:
- master
- develop
- feature
- test-action
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
name: Build
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Cache SonarQube packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build and analyze
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@6c92dc36709458d7d6e1ed85a661f492d074301a
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
run: ./gradlew build sonar --info
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_GHA }}
13 changes: 13 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sonar.projectKey=testavinot_test-sc-scan-gha
sonar.organization=testavinot

# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=test-sc-scan-gha
#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 ca73028

Please sign in to comment.