From 1a35f11fb16c3c00c95c2678d962315213f0ecf9 Mon Sep 17 00:00:00 2001 From: Mik-Nord Date: Tue, 28 Apr 2026 10:03:23 +0200 Subject: [PATCH 1/4] Build test suite --- .../automation-integration-test-build.yml | 50 +++++++++++++++++++ .../automation-integration-test-build.yml | 15 ++++++ 2 files changed, 65 insertions(+) create mode 100644 .github/workflows/automation-integration-test-build.yml create mode 100644 examples/automation-integration-test-build.yml diff --git a/.github/workflows/automation-integration-test-build.yml b/.github/workflows/automation-integration-test-build.yml new file mode 100644 index 0000000..4aba31f --- /dev/null +++ b/.github/workflows/automation-integration-test-build.yml @@ -0,0 +1,50 @@ +name: Integration test build + +on: + workflow_call: + inputs: + test-source-path: + description: 'Path to the Go test suite directory' + required: true + type: string + repository: + description: 'Repository to checkout (defaults to calling repo)' + required: false + type: string + default: '' + ref: + description: 'Git ref to checkout (defaults to calling ref)' + required: false + type: string + default: '' + artifact-name: + description: 'Name for the uploaded test binary artifact' + required: false + type: string + default: 'integration-test-binary' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + repository: ${{ inputs.repository || github.repository }} + ref: ${{ inputs.ref || github.ref }} + + - name: Setup Go + uses: actions/setup-go@v6 + with: + go-version-file: ${{ inputs.test-source-path }}/go.mod + cache-dependency-path: ${{ inputs.test-source-path }}/go.sum + + - name: Build test binary + working-directory: ${{ inputs.test-source-path }} + run: go test -c -v -vet=off -o /tmp/test.bin + + - name: Upload test binary + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.artifact-name }} + path: /tmp/test.bin diff --git a/examples/automation-integration-test-build.yml b/examples/automation-integration-test-build.yml new file mode 100644 index 0000000..7a84696 --- /dev/null +++ b/examples/automation-integration-test-build.yml @@ -0,0 +1,15 @@ +name: Integration test build +description: Builds a Go integration test binary and uploads it as an artifact. Designed for infrastructure integration tests that are compiled once and run against multiple environments. + +on: + push: + branches: [master] + +jobs: + build-test: + uses: dfds/shared-workflows/.github/workflows/automation-integration-test-build.yml@master + with: + test-source-path: test/integration/suite #Path to the Go test suite directory + repository: dfds/infrastructure-modules #Repository to checkout (optional, defaults to calling repo) + ref: master #Git ref to checkout (optional, defaults to calling ref) + artifact-name: test-binary #Name for the uploaded artifact (optional, defaults to integration-test-binary) From 2c20d0fce840f114c8137753372fe8ce22379f4c Mon Sep 17 00:00:00 2001 From: Mik-Nord Date: Tue, 28 Apr 2026 10:05:57 +0200 Subject: [PATCH 2/4] Remove comments --- examples/automation-integration-test-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/automation-integration-test-build.yml b/examples/automation-integration-test-build.yml index 7a84696..4177ccb 100644 --- a/examples/automation-integration-test-build.yml +++ b/examples/automation-integration-test-build.yml @@ -9,7 +9,7 @@ jobs: build-test: uses: dfds/shared-workflows/.github/workflows/automation-integration-test-build.yml@master with: - test-source-path: test/integration/suite #Path to the Go test suite directory - repository: dfds/infrastructure-modules #Repository to checkout (optional, defaults to calling repo) - ref: master #Git ref to checkout (optional, defaults to calling ref) - artifact-name: test-binary #Name for the uploaded artifact (optional, defaults to integration-test-binary) + test-source-path: test/integration/suite + repository: dfds/infrastructure-modules + ref: master + artifact-name: test-binary From 8cfff91ad8b69046961d63671a981c5927faad70 Mon Sep 17 00:00:00 2001 From: README-bot Date: Tue, 28 Apr 2026 08:06:25 +0000 Subject: [PATCH 3/4] Update readme [skip actions] --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 1824c81..d5d40c7 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Shared workflows and actions: - [Enforce PR labels](#enforce-pr-labels) - [Golang test suite](#golang-test-suite) - [Housekeeping](#housekeeping) + - [Integration test build](#integration-test-build) - [Multi architecture docker build](#multi-architecture-docker-build) - [Block on-hold PRs](#block-on-hold-prs) - [Add comment from PR template on Renovate pull requests](#add-comment-from-pr-template-on-renovate-pull-requests) @@ -162,6 +163,32 @@ jobs: status_checks: true ``` +### Integration test build + +_This is a workflow_ + +Builds a Go integration test binary and uploads it as an artifact. Designed for infrastructure integration tests that are compiled once and run against multiple environments. + +How to invoke this workflow: + +```yaml +name: Integration test build + +on: + push: + branches: [master] + +jobs: + build-test: + uses: dfds/shared-workflows/.github/workflows/automation-integration-test-build.yml@master + with: + test-source-path: test/integration/suite + repository: dfds/infrastructure-modules + ref: master + artifact-name: test-binary + +``` + ### Multi architecture docker build _This is a workflow_ From 8266c78fc5d8eb8266ce3fc64f203865fd64649e Mon Sep 17 00:00:00 2001 From: Mik-Nord Date: Tue, 28 Apr 2026 11:40:51 +0200 Subject: [PATCH 4/4] Added better example --- .github/workflows/automation-integration-test-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/automation-integration-test-build.yml b/.github/workflows/automation-integration-test-build.yml index 4aba31f..c5d1fb1 100644 --- a/.github/workflows/automation-integration-test-build.yml +++ b/.github/workflows/automation-integration-test-build.yml @@ -13,7 +13,7 @@ on: type: string default: '' ref: - description: 'Git ref to checkout (defaults to calling ref)' + description: 'Git ref to checkout. Accepts branch names (master, feature/foo), tags (v1.0.0), full refs (refs/heads/master, refs/tags/v1.0.0), or commit SHAs. Defaults to calling ref.' required: false type: string default: ''