Skip to content

Commit b4b538f

Browse files
ci: build deploy-camunda binary on the nightly integration path (#6439)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 367cb08 commit b4b538f

3 files changed

Lines changed: 38 additions & 10 deletions

File tree

.github/actions/generate-chart-matrix/action.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,6 @@ runs:
102102
- name: Export deploy-camunda to PATH
103103
shell: bash
104104
run: echo "$HOME/.local/bin" >> "$GITHUB_PATH"
105-
- name: Upload deploy-camunda binary
106-
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
107-
with:
108-
name: deploy-camunda-binary
109-
path: ~/.local/bin/deploy-camunda
110-
if-no-files-found: error
111-
retention-days: 1
112105
- name: Generate matrix
113106
shell: bash
114107
id: set-chart-versions

.github/workflows/test-integration-runner.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ on:
2727
description: The unique identifier of used in the deployment hostname.
2828
required: true
2929
type: string
30+
binary-artifact-name:
31+
description: Name of the uploaded deploy-camunda binary artifact to download. Callers that build the binary per-leg must override this with a per-run-unique name to avoid artifact-name collisions across parallel reusable-workflow legs.
32+
required: false
33+
default: deploy-camunda-binary
34+
type: string
3035
camunda-helm-repo:
3136
description: The Helm repo which is used during the upgrade flow.
3237
required: false
@@ -335,7 +340,7 @@ jobs:
335340
- name: Download deploy-camunda binary
336341
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
337342
with:
338-
name: deploy-camunda-binary
343+
name: ${{ inputs.binary-artifact-name }}
339344
path: ${{ runner.temp }}/bin
340345
- name: Add deploy-camunda to PATH
341346
run: |
@@ -798,7 +803,7 @@ jobs:
798803
- name: Download deploy-camunda binary
799804
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
800805
with:
801-
name: deploy-camunda-binary
806+
name: ${{ inputs.binary-artifact-name }}
802807
path: ${{ runner.temp }}/bin
803808
- name: Add deploy-camunda to PATH
804809
run: |
@@ -1475,7 +1480,7 @@ jobs:
14751480
- name: Download deploy-camunda binary
14761481
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
14771482
with:
1478-
name: deploy-camunda-binary
1483+
name: ${{ inputs.binary-artifact-name }}
14791484
path: ${{ runner.temp }}/bin
14801485
- name: Add deploy-camunda to PATH
14811486
run: |

.github/workflows/test-integration-template.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,35 @@ jobs:
323323
echo "${matrix}" | jq
324324
echo "matrix=$(echo ${matrix} | jq -c)" > "$GITHUB_OUTPUT"
325325
326+
- name: Restore deploy-camunda binary
327+
id: binary-cache
328+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
329+
with:
330+
path: ~/.local/bin/deploy-camunda
331+
key: deploy-camunda-v2-${{ runner.os }}-${{ hashFiles('scripts/deploy-camunda/**/*.go', 'scripts/deploy-camunda/go.sum') }}
332+
- name: Setup Go
333+
if: steps.binary-cache.outputs.cache-hit != 'true'
334+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
335+
with:
336+
go-version-file: scripts/deploy-camunda/go.mod
337+
cache: true
338+
cache-dependency-path: scripts/deploy-camunda/go.sum
339+
- name: Build deploy-camunda
340+
if: steps.binary-cache.outputs.cache-hit != 'true'
341+
shell: bash
342+
run: |
343+
mkdir -p "$HOME/.local/bin"
344+
# CGO_ENABLED=0 produces a static binary so it runs unchanged inside the
345+
# ci-runner container used by downstream matrix jobs.
346+
(cd scripts/deploy-camunda && CGO_ENABLED=0 go build -o "$HOME/.local/bin/deploy-camunda" .)
347+
- name: Upload deploy-camunda binary
348+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
349+
with:
350+
name: deploy-camunda-binary-${{ inputs.identifier }}
351+
path: ~/.local/bin/deploy-camunda
352+
if-no-files-found: error
353+
retention-days: 1
354+
326355
# The runner job is used to run the install/upgrade flows on the plaform (gke, rosa, etc.). This level of abstraction is needed so
327356
# we can shard the tests across multiple jobs (this is done via the matrix). If the tests where another job in this workflow, we
328357
# would need to wait for all the install/upgrade flows to complete before we can run the tests.
@@ -345,6 +374,7 @@ jobs:
345374
auth: ${{ inputs.auth }}
346375
exclude: ${{ inputs.exclude }}
347376
identifier: ${{ inputs.identifier }}-${{ inputs.shortname }}
377+
binary-artifact-name: deploy-camunda-binary-${{ inputs.identifier }}
348378
camunda-helm-repo: ${{ inputs.camunda-helm-repo }}
349379
camunda-helm-dir: ${{ inputs.camunda-helm-dir }}
350380
camunda-helm-git-ref: ${{ inputs.camunda-helm-git-ref }}

0 commit comments

Comments
 (0)