refactor(ci): implement selective module and concurrency #1986
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: Build Services | |
| on: | |
| workflow_call: | |
| inputs: | |
| push_image: | |
| description: "Push image" | |
| required: false | |
| type: boolean | |
| default: false | |
| push_image_tag: | |
| description: "Push image tag" | |
| default: "latest" | |
| required: false | |
| type: string | |
| disable_cilint: | |
| description: "Disable golangci-lint" | |
| default: false | |
| required: false | |
| type: boolean | |
| force_all: | |
| description: "Force build all modules (for release)" | |
| default: false | |
| required: false | |
| type: boolean | |
| workflow_dispatch: | |
| inputs: | |
| push_image: | |
| description: "Push image" | |
| required: false | |
| type: boolean | |
| default: false | |
| push_image_tag: | |
| description: "Push image tag" | |
| default: "latest" | |
| required: false | |
| type: string | |
| disable_cilint: | |
| description: "Disable golangci-lint" | |
| default: false | |
| required: false | |
| type: boolean | |
| push: | |
| branches: ["*"] | |
| paths: | |
| - "service/**" | |
| - "controllers/**" | |
| - ".github/workflows/services.yml" | |
| - ".github/workflows/service-build.yml" | |
| - "scripts/detect-build-modules.sh" | |
| - "!**/*.md" | |
| - "!**/*.yaml" | |
| pull_request: | |
| branches: ["*"] | |
| paths: | |
| - "service/**" | |
| - "controllers/**" | |
| - ".github/workflows/services.yml" | |
| - ".github/workflows/service-build.yml" | |
| - "scripts/detect-build-modules.sh" | |
| - "!**/*.md" | |
| - "!**/*.yaml" | |
| env: | |
| GO_VERSION: "1.25" | |
| DEFAULT_OWNER: "labring" | |
| permissions: | |
| contents: read | |
| packages: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| detect-changes: | |
| uses: ./.github/workflows/detect-changes.yml | |
| with: | |
| type: service | |
| force_all: ${{ inputs.force_all || false }} | |
| build-services: | |
| if: ${{ needs.detect-changes.outputs.modules != '[]' }} | |
| needs: [detect-changes] | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| module: ${{ fromJSON(needs.detect-changes.outputs.modules) }} | |
| uses: ./.github/workflows/service-build.yml | |
| with: | |
| module: ${{ matrix.module.name }} | |
| push_image: ${{ (github.event_name == 'push') || (github.event_name == 'create') || (inputs.push_image == true) }} | |
| push_image_tag: ${{ inputs.push_image_tag || 'latest' }} | |
| disable_cilint: ${{ inputs.disable_cilint || false }} | |
| secrets: inherit |