|
| 1 | +version: 0.2 |
| 2 | + |
| 3 | +# Consolidated CI for 8th-layer-agent — runs lint + test for every |
| 4 | +# component in one CodeBuild project (`8th-layer-agent-ci`, |
| 5 | +# account 124074140789, us-east-1). One pass/fail PR check. |
| 6 | +# |
| 7 | +# This replaces the nine `.github/workflows/ci-*.yaml` GitHub Actions |
| 8 | +# workflows (ci-cli, ci-install, ci-licenses, ci-plugin, ci-prompts-sync, |
| 9 | +# ci-schema, ci-sdk-go, ci-sdk-python, ci-server). Granular 9-way |
| 10 | +# splitting is deliberately out of scope — for a fork this size one |
| 11 | +# consolidated check is simpler to operate. If a check fails, the build |
| 12 | +# log names the failing component. |
| 13 | +# |
| 14 | +# Triggers (PR events + push to main) are encoded on the CodeBuild |
| 15 | +# project webhook FilterGroups, not here. |
| 16 | +# |
| 17 | +# Toolchains installed explicitly so the build is reproducible regardless |
| 18 | +# of the base image: |
| 19 | +# - Go 1.26.1 — cli/go.mod, schema/go.mod, sdk/go/go.mod all pin |
| 20 | +# 1.26.1, newer than the amazonlinux-standard:5.0 image |
| 21 | +# ships. Same curl-tarball pattern as cli-release.yml. |
| 22 | +# - golangci-lint v2.10.1 — pinned to match the GHA golangci-lint-action. |
| 23 | +# - uv — Python toolchain (astral-sh/setup-uv@v7 analog). |
| 24 | +# - Node 22 + pnpm 10 — server frontend (setup-node + pnpm/action-setup). |
| 25 | +# |
| 26 | +# `set -e` is in effect for every build command (CodeBuild default), so a |
| 27 | +# failing check fails the build. Components run in sequence; the first |
| 28 | +# failure aborts the build and the rest are skipped — the log shows which |
| 29 | +# component failed. |
| 30 | + |
| 31 | +env: |
| 32 | + variables: |
| 33 | + GO_VERSION: "1.26.1" |
| 34 | + GOLANGCI_LINT_VERSION: "v2.10.1" |
| 35 | + NODE_VERSION: "22" |
| 36 | + PNPM_VERSION: "10" |
| 37 | + UV_NO_PROGRESS: "1" |
| 38 | + UV_CACHE_DIR: /codebuild/output/.uv-cache |
| 39 | + |
| 40 | +phases: |
| 41 | + install: |
| 42 | + commands: |
| 43 | + - 'echo "=== Installing Go ${GO_VERSION} ==="' |
| 44 | + - 'curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" | tar -C /usr/local -xz' |
| 45 | + - 'export PATH="/usr/local/go/bin:$(go env GOPATH 2>/dev/null || echo $HOME/go)/bin:${PATH}"' |
| 46 | + - 'go version' |
| 47 | + - 'echo "=== Installing golangci-lint ${GOLANGCI_LINT_VERSION} ==="' |
| 48 | + - 'curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/local/bin "${GOLANGCI_LINT_VERSION}"' |
| 49 | + - 'golangci-lint --version' |
| 50 | + - 'echo "=== Installing uv (astral-sh/setup-uv@v7 analog) ==="' |
| 51 | + - 'curl -LsSf https://astral.sh/uv/install.sh | sh' |
| 52 | + - 'export PATH="$HOME/.local/bin:${PATH}"' |
| 53 | + - 'uv --version' |
| 54 | + - 'echo "=== Installing Node ${NODE_VERSION} + pnpm ${PNPM_VERSION} ==="' |
| 55 | + - 'n ${NODE_VERSION} || (curl -fsSL https://raw.githubusercontent.com/tj/n/master/bin/n | bash -s ${NODE_VERSION})' |
| 56 | + - 'node --version' |
| 57 | + - 'corepack enable' |
| 58 | + - 'corepack prepare "pnpm@${PNPM_VERSION}" --activate' |
| 59 | + - 'pnpm --version' |
| 60 | + |
| 61 | + build: |
| 62 | + commands: |
| 63 | + - 'export PATH="/usr/local/go/bin:$(go env GOPATH 2>/dev/null || echo $HOME/go)/bin:$HOME/.local/bin:${PATH}"' |
| 64 | + - 'echo "::: [prompts-sync] verifying SDK prompt copies match plugin sources"' |
| 65 | + - 'make check-prompts-sync' |
| 66 | + - 'echo "::: [schema] validate JSON Schema fixtures + values"' |
| 67 | + - 'make validate-schema' |
| 68 | + - 'echo "::: [schema] lint + test (Go module + Python package)"' |
| 69 | + - 'make setup-schema' |
| 70 | + - 'make lint-schema' |
| 71 | + - 'make test-schema' |
| 72 | + - 'echo "::: [cli] setup + lint (golangci-lint, check-licenses, check-notice)"' |
| 73 | + - 'make setup-cli' |
| 74 | + - 'make lint-cli' |
| 75 | + - 'echo "::: [cli] test + build"' |
| 76 | + - 'make test-cli' |
| 77 | + - '(cd cli && make build)' |
| 78 | + - 'echo "::: [sdk-go] setup + lint (prompts-sync, golangci-lint, licenses, notice)"' |
| 79 | + - 'make setup-sdk-go' |
| 80 | + - 'make lint-sdk-go' |
| 81 | + - 'echo "::: [sdk-go] test"' |
| 82 | + - 'make test-sdk-go' |
| 83 | + - 'echo "::: [licenses] covered by lint-cli + lint-sdk-go (check-licenses/check-notice)"' |
| 84 | + - 'echo "::: [plugin] setup + lint"' |
| 85 | + - 'make setup-plugin' |
| 86 | + - 'make lint-plugin' |
| 87 | + - 'echo "::: [plugin] test (Cursor hook helper)"' |
| 88 | + - 'make test-plugin' |
| 89 | + - 'echo "::: [install] setup + lint + test (installer + plugin hook)"' |
| 90 | + - 'make setup-install' |
| 91 | + - 'make lint-install' |
| 92 | + - 'make test-install' |
| 93 | + - 'echo "::: [sdk-python] setup + lint + test"' |
| 94 | + - 'make setup-sdk-python' |
| 95 | + - 'make lint-sdk-python' |
| 96 | + - 'make test-sdk-python' |
| 97 | + - 'echo "::: [server] setup + lint + test (backend + frontend)"' |
| 98 | + - 'make setup-server' |
| 99 | + - 'make lint-server' |
| 100 | + - 'make test-server' |
| 101 | + - 'echo "=== All CI checks passed ==="' |
| 102 | +cache: |
| 103 | + paths: |
| 104 | + - '/codebuild/output/.uv-cache/**/*' |
| 105 | + - '/root/.cache/uv/**/*' |
| 106 | + - '/root/.cache/go-build/**/*' |
| 107 | + - '/root/go/pkg/mod/**/*' |
0 commit comments