MVP реализации MoexVibe — NestJS бэкенд + React фронтенд + CI/CD #1
45
.gitea/workflows/ci.yml
Normal file
45
.gitea/workflows/ci.yml
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
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
|
||||||
23
apps/backend/.eslintrc.js
Normal file
23
apps/backend/.eslintrc.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
module.exports = {
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
parserOptions: {
|
||||||
|
project: 'tsconfig.json',
|
||||||
|
tsconfigRootDir: __dirname,
|
||||||
|
sourceType: 'module',
|
||||||
|
},
|
||||||
|
plugins: ['@typescript-eslint/eslint-plugin'],
|
||||||
|
extends: [
|
||||||
|
'plugin:@typescript-eslint/recommended',
|
||||||
|
],
|
||||||
|
root: true,
|
||||||
|
env: {
|
||||||
|
node: true,
|
||||||
|
jest: true,
|
||||||
|
},
|
||||||
|
ignorePatterns: ['.eslintrc.js'],
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
'@typescript-eslint/no-require-imports': 'off',
|
||||||
|
},
|
||||||
|
};
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { ApiProperty } from '@nestjs/swagger';
|
import { ApiProperty } from '@nestjs/swagger';
|
||||||
import { IsString, IsEnum, IsDateString } from 'class-validator';
|
import { IsEnum, IsDateString } from 'class-validator';
|
||||||
|
|
||||||
export enum CandleInterval {
|
export enum CandleInterval {
|
||||||
HOUR = '1h',
|
HOUR = '1h',
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Controller, Get, Query, ValidationPipe } from '@nestjs/common';
|
import { Controller, Get, Query, ValidationPipe } from '@nestjs/common';
|
||||||
import { ApiTags, ApiOperation, ApiQuery } from '@nestjs/swagger';
|
import { ApiTags, ApiOperation } from '@nestjs/swagger';
|
||||||
import { SecuritiesService } from './securities.service';
|
import { SecuritiesService } from './securities.service';
|
||||||
import { SearchQueryDto, SecurityType } from './dto/search-query.dto';
|
import { SearchQueryDto, SecurityType } from './dto/search-query.dto';
|
||||||
|
|
||||||
|
|||||||
110
docs/superpowers/plans/2026-06-13-cicd-implementation.md
Normal file
110
docs/superpowers/plans/2026-06-13-cicd-implementation.md
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
# 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'а зелёные.
|
||||||
46
docs/superpowers/specs/2026-06-13-cicd-design.md
Normal file
46
docs/superpowers/specs/2026-06-13-cicd-design.md
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
# CI/CD Pipeline for MoexVibe
|
||||||
|
|
||||||
|
**Date:** 2026-06-13
|
||||||
|
**Status:** Approved
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Continuous Integration pipeline using Gitea Actions (GitHub Actions-compatible format) for the MoexVibe monorepo.
|
||||||
|
|
||||||
|
## Triggers
|
||||||
|
|
||||||
|
- `push` to `main` branch
|
||||||
|
- `pull_request` into `main` branch
|
||||||
|
|
||||||
|
## Pipeline Structure
|
||||||
|
|
||||||
|
Three parallel jobs with no interdependencies:
|
||||||
|
|
||||||
|
| Job | Commands | Cache |
|
||||||
|
|---|---|---|
|
||||||
|
| `lint` | `npm ci` → `npm run lint` → `npx prettier --check "**/*.{ts,tsx}"` | npm |
|
||||||
|
| `test` | `npm ci` → `npm run test:backend` | npm |
|
||||||
|
| `build` | `npm ci` → `npm run build:backend` → `npm run build:frontend` | npm |
|
||||||
|
|
||||||
|
## Runtime
|
||||||
|
|
||||||
|
- `runs-on: ubuntu-latest` (Gitea Actions runner)
|
||||||
|
- Node.js 20
|
||||||
|
- npm cache via `actions/setup-node` with `cache: 'npm'`
|
||||||
|
|
||||||
|
## Configuration File
|
||||||
|
|
||||||
|
`.gitea/workflows/ci.yml`
|
||||||
|
|
||||||
|
## Project Changes
|
||||||
|
|
||||||
|
1. Create `.gitea/workflows/ci.yml`
|
||||||
|
2. Add `"format:check": "prettier --check \"**/*.{ts,tsx}\""` script to root `package.json`
|
||||||
|
|
||||||
|
## Explicitly Excluded
|
||||||
|
|
||||||
|
- Deployment (not required)
|
||||||
|
- Docker image building
|
||||||
|
- Artifact publishing
|
||||||
|
- Frontend tests (none exist in project)
|
||||||
|
- Frontend lint (no config exists)
|
||||||
@ -12,7 +12,8 @@
|
|||||||
"build:frontend": "npm run build -w apps/frontend",
|
"build:frontend": "npm run build -w apps/frontend",
|
||||||
"test:backend": "npm run test -w apps/backend",
|
"test:backend": "npm run test -w apps/backend",
|
||||||
"lint": "npm run lint -w apps/backend",
|
"lint": "npm run lint -w apps/backend",
|
||||||
"format": "prettier --write \"**/*.{ts,tsx}\""
|
"format": "prettier --write \"**/*.{ts,tsx}\"",
|
||||||
|
"format:check": "prettier --check \"**/*.{ts,tsx}\""
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"prettier": "^3.0.0"
|
"prettier": "^3.0.0"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user