From 4ac250a657020ece101293d69d55f7ef35e9db19 Mon Sep 17 00:00:00 2001 From: jedarden Date: Tue, 24 Mar 2026 10:54:43 -0400 Subject: [PATCH] Add GitHub Actions CI workflow for automated testing and builds - Runs Go engine tests with race detector on every push/PR - Runs TypeScript tests for worker-api and indexer - Builds web app and uploads artifacts - Builds all Go CLI tools (acb-local, acb-mapgen, acb-worker) Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 106 +++++++++++++++++++++++++++++++++++++++ PROGRESS.md | 14 ++++++ 2 files changed, 120 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..34e6e31 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,106 @@ +name: CI + +on: + push: + branches: [master, main] + pull_request: + branches: [master, main] + +jobs: + # Go engine tests + go-tests: + name: Go Tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.22' + cache: true + + - name: Run engine tests + run: go test ./engine/... -v -race + + - name: Build CLI tools + run: | + go build ./cmd/acb-local + go build ./cmd/acb-mapgen + go build ./cmd/acb-worker + + # Worker API tests + worker-api-tests: + name: Worker API Tests + runs-on: ubuntu-latest + defaults: + run: + working-directory: worker-api + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: worker-api/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + # Indexer tests + indexer-tests: + name: Indexer Tests + runs-on: ubuntu-latest + defaults: + run: + working-directory: cmd/acb-indexer + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: cmd/acb-indexer/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + # Web build + web-build: + name: Web Build + runs-on: ubuntu-latest + defaults: + run: + working-directory: web + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: web/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: web-dist + path: web/dist/ + retention-days: 7 diff --git a/PROGRESS.md b/PROGRESS.md index 2d03967..b6ec516 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -7,6 +7,11 @@ **Last Updated: 2026-03-24** ### Recent Changes (2026-03-24) +- Added GitHub Actions CI workflow (`.github/workflows/ci.yml`) + - Runs Go engine tests with race detector + - Runs TypeScript tests for worker-api and indexer + - Builds web app and uploads artifacts + - Builds all Go CLI tools - Added `README.md` with project overview and quick start guide - Added `.gitignore` for proper repository hygiene - Added `package-lock.json` files for reproducible builds @@ -45,6 +50,12 @@ - `/health` - Liveness probe (always returns 200) - `/ready` - Readiness probe (checks database connectivity, returns 503 if unavailable) - Documented in DEPLOYMENT.md +- [x] GitHub Actions CI workflow + - `.github/workflows/ci.yml` for automated testing + - Go tests with race detector + - TypeScript tests for worker-api and indexer + - Web build verification + - Go binary builds ### Remaining Phase 6 Work (requires Cloudflare account access) @@ -118,6 +129,9 @@ ai-code-battle/ ├── DEPLOYMENT.md # Deployment guide ├── docker-compose.bots.yml # Bot-host orchestration ├── docker-compose.workers.yml # Worker orchestration +├── .github/ +│ └── workflows/ +│ └── ci.yml # GitHub Actions CI workflow ├── engine/ │ ├── types.go # Core data types │ ├── grid.go # Toroidal grid implementation