From 8c468ccd7752e7f36909f90ad08a02fdee677da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Mon, 18 Nov 2024 15:45:29 +0100 Subject: [PATCH 1/2] fix: build artifact name properly (#2890) --- .github/workflows/ci-test-go.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-test-go.yml b/.github/workflows/ci-test-go.yml index 53de9a6e67..f32f172bcf 100644 --- a/.github/workflows/ci-test-go.yml +++ b/.github/workflows/ci-test-go.yml @@ -119,11 +119,18 @@ jobs: timeout-minutes: 30 run: make test-unit + - name: Set sonar artifact name + # For the core library, where the project directory is '.', we'll use "core" as artifact name. + # For the modules, we'll remove the slashes, keeping the name of the module + if: ${{ github.ref_name == 'main' && github.repository_owner == 'testcontainers' && inputs.run-tests && !inputs.rootless-docker && !inputs.ryuk-disabled }} + run: | + echo "ARTIFACT_NAME=$(basename ${{ inputs.project-directory == '.' && 'core' || inputs.project-directory }})-${{ inputs.go-version }}-${{ inputs.platform }}" >> $GITHUB_ENV + - name: Upload SonarCloud files if: ${{ github.ref_name == 'main' && github.repository_owner == 'testcontainers' && inputs.run-tests && !inputs.rootless-docker && !inputs.ryuk-disabled }} uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: - name: sonarcloud-${{ inputs.project-directory }}-${{ inputs.go-version }}-${{ inputs.platform }} + name: sonarcloud-${{ env.ARTIFACT_NAME }} path: | ./sonar-project.properties ${{ inputs.project-directory }}/TEST-unit.xml From 1b269070abed4c8bcb1ea53ff128078dce1f4aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20de=20la=20Pe=C3=B1a?= Date: Mon, 18 Nov 2024 16:59:14 +0100 Subject: [PATCH 2/2] fix: only upload to sonar on ubuntu-latest (#2891) --- .github/workflows/ci-test-go.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-test-go.yml b/.github/workflows/ci-test-go.yml index f32f172bcf..df544fdc61 100644 --- a/.github/workflows/ci-test-go.yml +++ b/.github/workflows/ci-test-go.yml @@ -122,12 +122,12 @@ jobs: - name: Set sonar artifact name # For the core library, where the project directory is '.', we'll use "core" as artifact name. # For the modules, we'll remove the slashes, keeping the name of the module - if: ${{ github.ref_name == 'main' && github.repository_owner == 'testcontainers' && inputs.run-tests && !inputs.rootless-docker && !inputs.ryuk-disabled }} + if: ${{ github.ref_name == 'main' && github.repository_owner == 'testcontainers' && inputs.platform == 'ubuntu-latest' && inputs.run-tests && !inputs.rootless-docker && !inputs.ryuk-disabled }} run: | echo "ARTIFACT_NAME=$(basename ${{ inputs.project-directory == '.' && 'core' || inputs.project-directory }})-${{ inputs.go-version }}-${{ inputs.platform }}" >> $GITHUB_ENV - name: Upload SonarCloud files - if: ${{ github.ref_name == 'main' && github.repository_owner == 'testcontainers' && inputs.run-tests && !inputs.rootless-docker && !inputs.ryuk-disabled }} + if: ${{ github.ref_name == 'main' && github.repository_owner == 'testcontainers' && inputs.platform == 'ubuntu-latest' && inputs.run-tests && !inputs.rootless-docker && !inputs.ryuk-disabled }} uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: sonarcloud-${{ env.ARTIFACT_NAME }}