chore(format): fix suggestions detected by gopls modernize #8589
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Main pipeline | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
detect-modules: | |
runs-on: ubuntu-latest | |
outputs: | |
modules: ${{ steps.set-modified-modules.outputs.modules }} | |
modules_count: ${{ steps.set-modified-modules-count.outputs.modules_count }} | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- id: changed-files | |
name: Get changed files | |
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46.0.3 | |
- id: set-modified-modules | |
name: Set all modified modules | |
env: | |
ALL_CHANGED_FILES: "${{ steps.changed-files.outputs.all_changed_files }}" | |
run: echo "modules=$(./scripts/changed-modules.sh)" >> $GITHUB_OUTPUT | |
- id: set-modified-modules-count | |
name: Set all modified modules count | |
run: echo "modules_count=$(echo ${{ toJSON(steps.set-modified-modules.outputs.modules) }} | jq '. | length')" >> $GITHUB_OUTPUT | |
- name: Print out the modules to be used | |
run: | | |
echo "${{ steps.set-modified-modules-count.outputs.modules_count }} modules in the build" | |
echo "${{ steps.set-modified-modules.outputs.modules }}" | |
lint: | |
# only run if there are modules to lint | |
if: ${{ needs.detect-modules.outputs.modules_count > 0 }} | |
needs: | |
- detect-modules | |
strategy: | |
matrix: | |
module: ${{ fromJSON(needs.detect-modules.outputs.modules) }} | |
uses: ./.github/workflows/ci-lint-go.yml | |
with: | |
project-directory: "${{ matrix.module }}" | |
test: | |
# only run if there are modules to test | |
if: ${{ needs.detect-modules.outputs.modules_count > 0 }} | |
needs: | |
- detect-modules | |
- lint | |
strategy: | |
# We don't want to fail the build the soonest but identify which modules passed and failed. | |
fail-fast: false | |
matrix: | |
go-version: [1.23.x, 1.24.x] | |
module: ${{ fromJSON(needs.detect-modules.outputs.modules) }} | |
permissions: | |
contents: read # for actions/checkout to fetch code | |
pull-requests: read # for sonarsource/sonarcloud-github-action to determine which PR to decorate | |
uses: ./.github/workflows/ci-test-go.yml | |
with: | |
go-version: ${{ matrix.go-version }} | |
platforms: ${{ matrix.module == 'modulegen' && '["ubuntu-latest", "macos-latest", "windows-latest"]' || '["ubuntu-latest"]' }} | |
project-directory: "${{ matrix.module }}" | |
testcontainers-cloud: false | |
rootless-docker: false | |
ryuk-disabled: false | |
secrets: inherit | |
# The job below is a copy of the job above, but using Docker Cloud. | |
test-testcontainers-cloud: | |
# the core module is identified by the empty string (the root path) | |
if: ${{ contains(fromJSON(needs.detect-modules.outputs.modules), '') }} | |
needs: | |
- detect-modules | |
- lint | |
name: "Test using Testcontainers Cloud" | |
strategy: | |
# We don't want to fail the build the soonest but identify which modules passed and failed. | |
fail-fast: false | |
matrix: | |
go-version: [1.23.x, 1.24.x] | |
uses: ./.github/workflows/ci-test-go.yml | |
with: | |
go-version: ${{ matrix.go-version }} | |
platforms: '["ubuntu-latest"]' | |
project-directory: "." | |
testcontainers-cloud: true | |
rootless-docker: false | |
ryuk-disabled: false | |
# The job below is a copy of the job above, but with ryuk disabled. | |
# It's executed in the first stage to avoid concurrency issues. | |
test-reaper-off: | |
# the core module is identified by the empty string (the root path) | |
if: ${{ contains(fromJSON(needs.detect-modules.outputs.modules), '') }} | |
needs: | |
- detect-modules | |
- lint | |
name: "Test with reaper off" | |
strategy: | |
matrix: | |
go-version: [1.23.x, 1.24.x] | |
uses: ./.github/workflows/ci-test-go.yml | |
with: | |
go-version: ${{ matrix.go-version }} | |
platforms: '["ubuntu-latest"]' | |
project-directory: "." | |
testcontainers-cloud: false | |
rootless-docker: false | |
ryuk-disabled: true | |
# The job below is a copy of the job above, but with Docker rootless. | |
# It's executed in the first stage to avoid concurrency issues. | |
test-rootless-docker: | |
# the core module is identified by the empty string (the root path) | |
if: ${{ contains(fromJSON(needs.detect-modules.outputs.modules), '') }} | |
needs: | |
- detect-modules | |
- lint | |
name: "Test with Rootless Docker" | |
strategy: | |
matrix: | |
go-version: [1.23.x, 1.24.x] | |
uses: ./.github/workflows/ci-test-go.yml | |
with: | |
go-version: ${{ matrix.go-version }} | |
platforms: '["ubuntu-latest"]' | |
project-directory: "." | |
testcontainers-cloud: false | |
rootless-docker: true | |
ryuk-disabled: false | |
# This job serves as confirmation that all test jobs finished | |
end: | |
if: ${{ needs.detect-modules.outputs.modules_count > 0 }} | |
needs: | |
- detect-modules | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check if any jobs failed | |
if: ${{ failure() || cancelled() }} | |
run: exit 1 | |
- run: echo "All tests completed successfully!" |