From 0a6effbd0e62b50ba452536829529601f153ba9b Mon Sep 17 00:00:00 2001 From: Atze de Vries Date: Wed, 8 Oct 2025 16:43:12 +0200 Subject: [PATCH] feat: allow settings gomaxprocs in workflows Signed-off-by: Atze de Vries --- .github/workflows/goapp.yaml | 10 ++++++++-- .github/workflows/reusable-goapp.yaml | 6 ++++++ .github/workflows/reusable-terraform.yaml | 6 ++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/goapp.yaml b/.github/workflows/goapp.yaml index b7616c3c..59a8193f 100644 --- a/.github/workflows/goapp.yaml +++ b/.github/workflows/goapp.yaml @@ -33,6 +33,10 @@ on: type: string default: "" description: A comma separated list of Globs which triggers terraform ci + go-maxprocs: + type: number + default: 2 + description: Set the GOMAXPROCS env to this value. Runners have 2 cpus for private repos and 4 for public repos outputs: oci-images: value: ${{ jobs.goapp.outputs.oci-images }} @@ -73,7 +77,7 @@ jobs: name: Go application needs: ["detect-changes"] if: ${{ needs.detect-changes.outputs.golang == 'true' }} - uses: coopnorge/mage/.github/workflows/reusable-goapp.yaml@main + uses: coopnorge/mage/.github/workflows/reusable-goapp.yaml@update-go-app-workflow permissions: contents: read id-token: write @@ -84,12 +88,13 @@ jobs: push-oci-image: ${{ inputs.push-oci-image }} workload-identity-provider: ${{ inputs.workload-identity-provider }} service-account: ${{ inputs.service-account }} + go-maxprocs: ${{ inputs.go-maxprocs }} terraform: name: Terraform needs: ["detect-changes"] if: ${{ needs.detect-changes.outputs.terraform == 'true' }} - uses: coopnorge/mage/.github/workflows/reusable-terraform.yaml@main + uses: coopnorge/mage/.github/workflows/reusable-terraform.yaml@update-go-app-workflow permissions: contents: read pull-requests: write @@ -99,3 +104,4 @@ jobs: secrets: inherit with: dependabot-automerge-enabled: true + go-maxprocs: ${{ inputs.go-maxprocs }} diff --git a/.github/workflows/reusable-goapp.yaml b/.github/workflows/reusable-goapp.yaml index a15d64a8..2c2a38fa 100644 --- a/.github/workflows/reusable-goapp.yaml +++ b/.github/workflows/reusable-goapp.yaml @@ -25,6 +25,11 @@ on: type: string default: "docker" description: Run mage go related tasks in "docker" (default) or local + go-maxprocs: + type: number + default: 2 + description: Set the GOMAXPROCS env to this value. Runners have 2 cpus for private repos and 4 for public repos + outputs: oci-images: value: ${{ jobs.mage.outputs.oci-images }} @@ -89,6 +94,7 @@ jobs: OCI_IMAGE_BASE: ${{ inputs.oci-image-base }} PUSH_IMAGE: ${{ inputs.push-oci-image }} GO_RUNTIME: ${{ inputs.go-runtime }} + GOMAXPROCS: ${{ inputs.go-maxprocs }} - id: oci-images name: Output OCI images references run: | diff --git a/.github/workflows/reusable-terraform.yaml b/.github/workflows/reusable-terraform.yaml index de6f6d7d..a7786696 100644 --- a/.github/workflows/reusable-terraform.yaml +++ b/.github/workflows/reusable-terraform.yaml @@ -33,6 +33,10 @@ on: default: false description: | Only run validation and skip spacelift checks + go-maxprocs: + type: number + default: 2 + description: Set the GOMAXPROCS env to this value. Runners have 2 cpus for private repos and 4 for public repos secrets: {} jobs: @@ -71,6 +75,8 @@ jobs: - name: Code Validation id: validate run: go tool mage terraform:validate + env: + GOMAXPROCS: ${{ inputs.go-maxprocs }} - name: Cleanup if: always()