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
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
Expand All @@ -17,6 +18,8 @@ jobs:
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up Java
uses: actions/setup-java@v4
Expand All @@ -27,5 +30,20 @@ jobs:
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4

- name: Cache SonarQube packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Build and test
run: ./gradlew build

- name: SonarQube analysis
# Analysis is advisory: a failed or unconfigured scan must not fail the build.
continue-on-error: true
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
run: ./gradlew sonar --info
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
plugins {
id 'application'
id "org.sonarqube" version "7.3.1.8318"
}

sonar {
properties {
property "sonar.projectKey", "deprecated-java-api-demo-2"
property "sonar.projectName", "deprecated-java-api-demo-2"
}
}

group = 'dev.trly.java.example.primitive.wrappers'
Expand Down
Loading