moex-vibe/docs/superpowers/plans/2026-06-13-cicd-implementation.md
Sergey Krylov d32ca22acd
Some checks failed
CI / lint (pull_request) Failing after 5m47s
CI / test (pull_request) Successful in 9m46s
CI / build (pull_request) Successful in 9m52s
ci: add Gitea Actions pipeline with lint, test, build
2026-06-13 19:57:30 +03:00

111 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# CI/CD Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Add Gitea Actions CI pipeline with lint, test, and build for the MoexVibe monorepo.
**Architecture:** Single `.gitea/workflows/ci.yml` file with three parallel jobs (lint, test, build) triggered on push/PR to main. One script addition to root `package.json` for format checking.
**Tech Stack:** Gitea Actions (GitHub Actions-compatible YAML), Node.js 20, npm workspaces
---
### Task 1: Add `format:check` script to root package.json
**Files:**
- Modify: `package.json` (root)
- [ ] **Step 1: Read root package.json**
- [ ] **Step 2: Add format:check script**
Edit `package.json`: add `"format:check": "prettier --check \"**/*.{ts,tsx}\""` to the `scripts` section, after `format`.
- [ ] **Step 3: Verify the script runs**
Run: `npm run format:check`
Expected: exits 0 (all files already formatted) or lists formatting errors
- [ ] **Step 4: Commit**
```bash
git add package.json
git commit -m "ci: add format:check script for CI pipeline"
```
---
### Task 2: Create Gitea Actions workflow
**Files:**
- Create: `.gitea/workflows/ci.yml`
- [ ] **Step 1: Create workflow directory**
Run: `mkdir -p .gitea/workflows`
- [ ] **Step 2: Create ci.yml with full pipeline**
Create `.gitea/workflows/ci.yml`:
```yaml
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
NODE_VERSION: 20
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run lint
- run: npx prettier --check "**/*.{ts,tsx}"
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run test:backend
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run build:backend
- run: npm run build:frontend
```
- [ ] **Step 3: Commit**
```bash
git add .gitea/workflows/ci.yml
git commit -m "ci: add Gitea Actions pipeline with lint, test, build"
```
---
### Verification
После пуша в `main` (или создания PR) проверить на https://git.ksv741.keenetic.pro/moex/moex-vibe/actions что pipeline запустился и все 3 job'а зелёные.