Repository navigation
fix(costcenter): add Workspace ID filtering (#7336) #2698
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 | |
| # Avoid using ${{ github.workflow }} - when called via workflow_call, it inherits the caller's name causing conflicts | |
| concurrency: | |
| group: services-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| shared-unit-test: | |
| name: Test shared service packages with race detector | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Golang with cache | |
| uses: magnetikonline/action-golang-cache@v5 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Run Tests with race detector | |
| working-directory: service | |
| run: go test -race ./... -count=1 -v | |
| 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 |