From 968b486245c5c71cb245a3070ab7d3113eac9859 Mon Sep 17 00:00:00 2001 From: "antoine.vinot" Date: Tue, 21 May 2024 10:45:32 +0200 Subject: [PATCH] SQSCANGHA-20 Add detection of Kotlin Gradle configuration --- .github/workflows/qa.yml | 20 ++++++++++++++++++++ entrypoint.sh | 2 +- test/gradle-project-kotlin/build.gradle.kts | 0 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 test/gradle-project-kotlin/build.gradle.kts diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index b632014..5d0f337 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -81,6 +81,26 @@ jobs: - name: Assert run: | ./test/assertFileExists ./output.properties + dontFailGradleKotlinTest: + name: > + Don't fail on Kotlin Gradle project + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Run action on Kotlin Gradle project + id: runTest + uses: ./ + continue-on-error: true + env: + SONAR_HOST_URL: http://not_actually_used + with: + projectBaseDir: ./test/gradle-project + args: -Dsonar.scanner.dumpToFile=./output.properties + - name: Assert + run: | + ./test/assertFileExists ./output.properties dontFailMavenTest: name: > Don't fail on Maven project diff --git a/entrypoint.sh b/entrypoint.sh index 24911d0..2bdd5d5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -25,7 +25,7 @@ if [[ -f "${INPUT_PROJECTBASEDIR%/}/pom.xml" ]]; then to get more accurate results." fi -if [[ -f "${INPUT_PROJECTBASEDIR%/}/build.gradle" ]]; then +if [[ -f "${INPUT_PROJECTBASEDIR%/}/build.gradle" || -f "${INPUT_PROJECTBASEDIR%/}/build.gradle.kts" ]]; then echo "WARNING! Gradle project detected. Sonar recommends using the SonarQube plugin for Gradle during the build process instead of using this GitHub Action to get more accurate results." fi diff --git a/test/gradle-project-kotlin/build.gradle.kts b/test/gradle-project-kotlin/build.gradle.kts new file mode 100644 index 0000000..e69de29