Skip to content
Draft
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
21 changes: 21 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,23 @@ 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
# SONAR_PROJECT_KEY is a repository variable holding the key SonarQube
# assigned when this repo was imported via the GitHub App.
if: ${{ vars.SONAR_PROJECT_KEY != '' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
run: ./gradlew sonar --info -Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }}
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.projectName", "deprecated-java-api-demo-5"
property "sonar.links.scm", "https://github.com/sourcegraph-testing/deprecated-java-api-demo-5"
}
}

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