Skip to content

fix ci pipeline

fix ci pipeline #3

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
- run: pnpm install --frozen-lockfile
- run: pnpm prisma generate
- uses: actions/cache/save@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('pnpm-lock.yaml') }}
lint:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm lint:check
format:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm format:check
typecheck:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm typecheck
unit-tests:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm test:cov
- uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: coverage/
retention-days: 7
build:
needs: unit-tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm build
e2e-tests:
needs: build
runs-on: ubuntu-latest
services:
postgres:
image: postgres:18-alpine
env:
POSTGRES_USER: ci
POSTGRES_PASSWORD: ci
POSTGRES_DB: ci
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U ci"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:8-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL: postgresql://ci:ci@localhost:5432/ci
JWT_ACCESS_SECRET: ci-access-secret
JWT_REFRESH_SECRET: ci-refresh-secret
REDIS_HOST: localhost
REDIS_PORT: 6379
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/cache/restore@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm prisma migrate deploy
- run: pnpm test:e2e