chore: clean up dockerconfig public API #38
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-packages: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| packages: ${{ steps.filter.outputs.changes || '[]' }} | |
| steps: | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Generate filters | |
| id: filter-setup | |
| run: | | |
| filters=$(go work edit -json | jq -r '.Use[] | "\(.DiskPath | ltrimstr("./")): \"\(.DiskPath | ltrimstr("./"))/**\""') | |
| echo "filters<<EOF" >> $GITHUB_OUTPUT | |
| echo "$filters" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| shell: bash | |
| - name: Filter changes | |
| id: filter | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: ${{ steps.filter-setup.outputs.filters }} | |
| lint: | |
| needs: | |
| - detect-packages | |
| if: needs.detect-packages.outputs.packages != '[]' # Ensure job runs only if there are changes | |
| strategy: | |
| matrix: | |
| package: ${{ fromJSON(needs.detect-packages.outputs.packages || '[]') }} | |
| uses: ./.github/workflows/ci-lint-go.yml | |
| with: | |
| project-directory: "${{ matrix.package }}" | |
| test: | |
| needs: | |
| - detect-packages | |
| - lint | |
| if: needs.detect-packages.outputs.packages != '[]' # Ensure job runs only if there are changes | |
| 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] | |
| package: ${{ fromJSON(needs.detect-packages.outputs.packages || '[]') }} | |
| 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: '["ubuntu-latest", "macos-latest", "windows-latest"]' | |
| project-directory: "${{ matrix.package }}" | |
| secrets: inherit | |
| # This job serves as confirmation that all test jobs finished | |
| end: | |
| if: needs.detect-packages.outputs.packages != '[]' # Ensure job runs only if there are changes | |
| needs: | |
| - detect-packages | |
| - test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check if any jobs failed | |
| if: ${{ failure() || cancelled() }} | |
| run: exit 1 | |
| - run: echo "All tests completed successfully!" |