Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions .github/workflows/CI-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: CI workflow

on:
pull_request:
branches: ['dev', 'main']
paths-ignore:
- '*.md'
- 'docs/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

Comment thread
maksberegovoi marked this conversation as resolved.
Comment thread
maksberegovoi marked this conversation as resolved.
jobs:
frontend:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'

- name: Install deps
run: pnpm install --frozen-lockfile

- name: Lint
run: pnpm lint:frontend

- name: Lint FSD
run: pnpm lint:fsd:frontend

- name: Format
run: pnpm format:check:frontend

- name: Typecheck
run: pnpm typecheck:frontend

# - name: Unit tests
# run: pnpm test:frontend:ci

- name: Build
run: pnpm build:frontend

# - name: Build Storybook
# run: pnpm build-storybook

backend:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:16
env:
POSTGRES_DB: test
POSTGRES_USER: test
POSTGRES_PASSWORD: test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready"
--health-interval=10s
--health-timeout=5s
--health-retries=5

env:
DATABASE_URL: postgresql://test:test@localhost:5432/test
PORT: 3000
JWT_SECRET: test
JWT_EXPIRES_IN: 7d
NODE_ENV: test

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'

- name: Install deps
run: pnpm install --frozen-lockfile

- name: Prisma generate
run: pnpm prisma:generate:backend

- name: Apply migrations (test DB)
run: pnpm prisma:migrate:deploy:backend

- name: Lint
run: pnpm lint:backend

- name: Format
run: pnpm format:check:backend

- name: Typecheck
run: pnpm typecheck:backend

- name: Unit tests
run: pnpm test:backend:ci

- name: Build
run: pnpm build:backend
70 changes: 0 additions & 70 deletions .github/workflows/backend-ci.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/frontend-ci.yml

This file was deleted.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
"lint:fix": "pnpm run --recursive lint:fix",
"format": "pnpm run --recursive format",
"format:check": "pnpm run --recursive format:check",

"lint:frontend": "pnpm --filter @task-tracker/frontend lint",
Comment thread
maksberegovoi marked this conversation as resolved.
"format:check:frontend": "pnpm --filter @task-tracker/frontend format:check",
"lint:fsd:frontend": "pnpm --filter @task-tracker/frontend lint:fsd",
"typecheck:frontend": "pnpm --filter @task-tracker/frontend type-check",
"typecheck:frontend": "pnpm --filter @task-tracker/frontend typecheck",
"build:frontend": "pnpm --filter @task-tracker/frontend build",

"dev:backend": "pnpm --filter @task-tracker/backend start:dev",
"start:backend": "pnpm --filter @task-tracker/backend start:prod",
"build:backend": "pnpm --filter @task-tracker/backend build",
"lint:backend": "pnpm --filter @task-tracker/backend lint",
"format:check:backend": "pnpm --filter @task-tracker/backend format:check",
"test:backend:ci": "pnpm --filter @task-tracker/backend test:ci",
"typecheck:backend": "pnpm --filter @task-tracker/backend type-check",
"typecheck:backend": "pnpm --filter @task-tracker/backend typecheck",
"prisma:generate:backend": "pnpm --filter @task-tracker/backend prisma:generate",
"prisma:migrate:deploy:backend": "pnpm --filter @task-tracker/backend prisma:migrate:deploy"
},
Expand Down