From 0e560a3d391132250147fbae0c8e209114bf748e Mon Sep 17 00:00:00 2001 From: David Bickford Date: Fri, 20 Mar 2026 15:49:26 -0400 Subject: [PATCH 1/3] Add PRE_TEST_COMMANDS, PARALLEL, MOCKERY_INSTALL_VERSION to build-and-test --- .gitignore | 3 +++ go/build-and-test/action.yml | 28 +++++++++++++++++++++++++++- go/build/action.yml | 10 ++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7e874de..414c85f 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,6 @@ typings/ # next.js build output .next + +# Local planning docs +docs/ diff --git a/go/build-and-test/action.yml b/go/build-and-test/action.yml index 48c11cf..28c6481 100644 --- a/go/build-and-test/action.yml +++ b/go/build-and-test/action.yml @@ -36,6 +36,18 @@ inputs: description: A timeout value in seconds. If tests take longer than this, they will fail. Not setting this value will fallback to go test's default of 10 minutes. required: false default: "" + PRE_TEST_COMMANDS: + description: Shell commands to run between build and test steps (e.g. DB migrations, code generation) + required: false + default: "" + PARALLEL: + description: Whether to run tests in parallel. Defaults to true. + required: false + default: "true" + MOCKERY_INSTALL_VERSION: + description: The version of mockery to use + required: false + default: "" runs: using: "composite" @@ -44,11 +56,24 @@ runs: id: branch-info uses: wishabi/github-actions/common/branch-info@v0 - name: Run custom Go build action - uses: wishabi/github-actions/go/build@v0 + uses: wishabi/github-actions/go/build@pre-test-commands with: FLIPPCIRCLECIPULLER_REPO_TOKEN: ${{ inputs.FLIPPCIRCLECIPULLER_REPO_TOKEN }} BUF_BUILD_USER: ${{ inputs.BUF_BUILD_USER }} BUF_BUILD_API_TOKEN: ${{ inputs.BUF_BUILD_API_TOKEN }} + MOCKERY_INSTALL_VERSION: ${{ inputs.MOCKERY_INSTALL_VERSION }} + - name: Run pre-test commands + if: ${{ inputs.PRE_TEST_COMMANDS != '' }} + shell: bash + run: | + set -e + eval "$PRE_TEST_COMMANDS" + env: + PRE_TEST_COMMANDS: ${{ inputs.PRE_TEST_COMMANDS }} + DB_HOST: ${{ inputs.DB_HOST }} + DB_USER: ${{ inputs.DB_USER }} + DB_PASSWORD: ${{ inputs.DB_PASSWORD }} + DB_PORT: ${{ inputs.DB_PORT }} - name: Run custom Go test action uses: wishabi/github-actions/go/test@v0 env: @@ -59,6 +84,7 @@ runs: with: TAGS: ${{ inputs.TEST_TAGS }} TIMEOUT: ${{ inputs.TIMEOUT }} + PARALLEL: ${{ inputs.PARALLEL }} - name: Notify slack channel on failure if: failure() && inputs.SLACK_CHANNEL_ID != '' && github.ref == 'refs/heads/main' uses: slackapi/slack-github-action@v1.27.1 diff --git a/go/build/action.yml b/go/build/action.yml index 4b8572c..26c5ec4 100644 --- a/go/build/action.yml +++ b/go/build/action.yml @@ -17,6 +17,14 @@ inputs: SLACK_BOT_TOKEN: description: The Slack bot token to pass the data to required: false + MOCKERY_INSTALL_VERSION: + description: The version of mockery to use + required: false + default: "" + CODE_GEN_COMMANDS: + description: Shell commands to run before go mod tidy (e.g. sqlc generate, wire, ent generate) + required: false + default: "" runs: using: "composite" @@ -36,6 +44,8 @@ runs: BUF_TOKEN: ${{ inputs.BUF_BUILD_API_TOKEN }} with: FLIPPCIRCLECIPULLER_REPO_TOKEN: ${{ inputs.FLIPPCIRCLECIPULLER_REPO_TOKEN }} + MOCKERY_INSTALL_VERSION: ${{ inputs.MOCKERY_INSTALL_VERSION }} + CODE_GEN_COMMANDS: ${{ inputs.CODE_GEN_COMMANDS }} - name: Write build summary if: always() shell: bash From c9e6f15947c8069ba96c06e005ca38780e4cb573 Mon Sep 17 00:00:00 2001 From: David Bickford Date: Mon, 23 Mar 2026 09:35:01 -0400 Subject: [PATCH 2/3] Rename PRE_TEST_COMMANDS to TEST_SETUP_COMMANDS, add CODE_GEN_COMMANDS to deps --- go/build-and-test/action.yml | 19 ++++++++++++------- go/deps/action.yml | 12 ++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/go/build-and-test/action.yml b/go/build-and-test/action.yml index 28c6481..606f2d9 100644 --- a/go/build-and-test/action.yml +++ b/go/build-and-test/action.yml @@ -36,8 +36,8 @@ inputs: description: A timeout value in seconds. If tests take longer than this, they will fail. Not setting this value will fallback to go test's default of 10 minutes. required: false default: "" - PRE_TEST_COMMANDS: - description: Shell commands to run between build and test steps (e.g. DB migrations, code generation) + TEST_SETUP_COMMANDS: + description: Shell commands to run between build and test steps (e.g. DB migrations, seed data, config generation) required: false default: "" PARALLEL: @@ -48,6 +48,10 @@ inputs: description: The version of mockery to use required: false default: "" + CODE_GEN_COMMANDS: + description: Shell commands to run before go mod tidy (e.g. sqlc generate, wire, ent generate) + required: false + default: "" runs: using: "composite" @@ -56,20 +60,21 @@ runs: id: branch-info uses: wishabi/github-actions/common/branch-info@v0 - name: Run custom Go build action - uses: wishabi/github-actions/go/build@pre-test-commands + uses: wishabi/github-actions/go/build@v0 with: FLIPPCIRCLECIPULLER_REPO_TOKEN: ${{ inputs.FLIPPCIRCLECIPULLER_REPO_TOKEN }} BUF_BUILD_USER: ${{ inputs.BUF_BUILD_USER }} BUF_BUILD_API_TOKEN: ${{ inputs.BUF_BUILD_API_TOKEN }} MOCKERY_INSTALL_VERSION: ${{ inputs.MOCKERY_INSTALL_VERSION }} - - name: Run pre-test commands - if: ${{ inputs.PRE_TEST_COMMANDS != '' }} + CODE_GEN_COMMANDS: ${{ inputs.CODE_GEN_COMMANDS }} + - name: Run test setup commands + if: ${{ inputs.TEST_SETUP_COMMANDS != '' }} shell: bash run: | set -e - eval "$PRE_TEST_COMMANDS" + eval "$TEST_SETUP_COMMANDS" env: - PRE_TEST_COMMANDS: ${{ inputs.PRE_TEST_COMMANDS }} + TEST_SETUP_COMMANDS: ${{ inputs.TEST_SETUP_COMMANDS }} DB_HOST: ${{ inputs.DB_HOST }} DB_USER: ${{ inputs.DB_USER }} DB_PASSWORD: ${{ inputs.DB_PASSWORD }} diff --git a/go/deps/action.yml b/go/deps/action.yml index 4aa01e4..10f9d61 100644 --- a/go/deps/action.yml +++ b/go/deps/action.yml @@ -13,6 +13,10 @@ inputs: description: The version of mockery to use required: false default: "" + CODE_GEN_COMMANDS: + description: Shell commands to run before go mod tidy (e.g. sqlc generate, wire, ent generate) + required: false + default: "" runs: using: 'composite' @@ -35,6 +39,14 @@ runs: echo "Go: $(go version)" if command -v buf &> /dev/null; then echo "Buf: $(buf --version)"; fi echo "::endgroup::" + - name: Run code generation commands + if: ${{ inputs.CODE_GEN_COMMANDS != '' }} + shell: bash + run: | + set -e + eval "$CODE_GEN_COMMANDS" + env: + CODE_GEN_COMMANDS: ${{ inputs.CODE_GEN_COMMANDS }} - name: Setting up private modules access if: steps.vendor-cache.outputs.cache-hit != 'true' shell: bash From 30c85eac55c36c19a4c11001ed5a133e48f1521d Mon Sep 17 00:00:00 2001 From: David Bickford Date: Mon, 23 Mar 2026 13:31:28 -0400 Subject: [PATCH 3/3] Add composite actions reference to README --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index 1e3bf44..32ff894 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,41 @@ slack_always|No|If set, both success and failure notifications will be sent to S enable_ssh|No|If set, SSH sessions will be created on failure. ssh_always|No|If set, SSH sessions will always be created, even on success. +## Composite Actions + +This repo also contains reusable composite actions for CI/CD pipelines: + +### Go +| Action | Description | +|--------|-------------| +| `go/build` | Build Go repo, configure environment, install dependencies | +| `go/test` | Run Go tests with coverage and artifact upload | +| `go/lint` | Run golangci-lint with v1/v2 config auto-detection | +| `go/build-and-test` | Combined build + test with optional `TEST_SETUP_COMMANDS` and `CODE_GEN_COMMANDS` | +| `go/deps` | Install Go dependencies, vendor modules, generate mocks. Supports `CODE_GEN_COMMANDS` for pre-vendor code generation (sqlc, wire, ent) | +| `go/configure` | Configure Go environment (GOPRIVATE, buf, etc.) | +| `go/smoke-test` | Post-deploy smoke tests with optional DataDog Synthetics | + +### Ruby +| Action | Description | +|--------|-------------| +| `ruby/deps` | Install Ruby dependencies via Bundler | +| `ruby/lint` | Run RuboCop linter | +| `ruby/test` | Run RSpec tests with artifact upload | +| `ruby/one-for-all` | One-for-all Helm chart validation | +| `ruby/validation/topic` | Kafka topic validation | +| `ruby/validation/schema` | Schema validation | + +### Shared +| Action | Description | +|--------|-------------| +| `deploy/eks` | Deploy to EKS (staging/production) with Slack notifications | +| `slack` | Send Slack notifications on job failure/success | +| `cache` | Cache/restore workspace between jobs | +| `common/branch-info` | Extract branch name and short SHA for use in other steps | + +Each action's inputs are documented in its `action.yml` file. Use `@v0` to track the latest stable version. + ## Contributing Please make sure to run `npm run prepare` before committing your files! You should probably add this to `.git/hooks/pre-commit`.