From b1b4a0781ac0c428e0bfeb886be84da19b096596 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Tue, 12 Sep 2023 03:07:12 +0200 Subject: [PATCH] ci(sonarcloud): run only when not root-less (#1608) Signed-off-by: Matthieu MOREL --- .github/workflows/ci-test-go.yml | 4 ++-- .golangci.yml | 1 - sonar-project.properties | 6 +++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-test-go.yml b/.github/workflows/ci-test-go.yml index 201316d0ba..d8890a5264 100644 --- a/.github/workflows/ci-test-go.yml +++ b/.github/workflows/ci-test-go.yml @@ -79,7 +79,7 @@ jobs: # Optional: working directory, useful for monorepos working-directory: ${{ inputs.project-directory }} # Optional: golangci-lint command line arguments. - args: --verbose + args: --verbose --out-format=checkstyle:golangci-lint.report.xml # Optional: if set to true then the all caching functionality will be complete disabled, # takes precedence over all other caching options. skip-cache: true @@ -109,7 +109,7 @@ jobs: make test-unit - name: Analyze with SonarCloud - if: ${{ github.ref_name == 'main' && github.repository_owner == 'testcontainers' && inputs.run-tests && inputs.project-directory == '.' }} + if: ${{ github.ref_name == 'main' && github.repository_owner == 'testcontainers' && inputs.run-tests && !inputs.rootless-docker && inputs.project-directory == '.' }} uses: sonarsource/sonarcloud-github-action@master with: projectBaseDir: ${{ inputs.project-directory }} diff --git a/.golangci.yml b/.golangci.yml index 98adfe4db4..58c788bf9f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -22,6 +22,5 @@ linters-settings: - standard - default - prefix(github.com/testcontainers) - run: timeout: 5m diff --git a/sonar-project.properties b/sonar-project.properties index 629622e679..611c555085 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -5,13 +5,17 @@ sonar.organization=testcontainers sonar.projectKey=testcontainers_testcontainers-go sonar.projectName=testcontainers-go + sonar.projectVersion=v0.23.0 sonar.sources=. + sonar.exclusions=**/*_test.go,**/vendor/**,**/testdata/* sonar.tests=. sonar.test.inclusions=**/*_test.go sonar.test.exclusions=**/vendor/** -sonar.go.tests.reportPaths=TEST-*.xml + sonar.go.coverage.reportPaths=coverage.out +sonar.go.golangci-lint.reportPaths=golangci-lint.report.xml +sonar.go.tests.reportPaths=TEST-unit.xml