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
17 changes: 17 additions & 0 deletions .github/actions/setup-node-pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Setup Node and PNPM
description: Setup node and pnpm
runs:
using: "composite"
steps:
- uses: pnpm/action-setup@v4
with:
version: 10.11.1

- uses: actions/setup-node@v4
with:
node-version: 22.16.0
cache: "pnpm"

- name: Installation of project dependencies
shell: bash
run: pnpm install --frozen-lockfile
26 changes: 8 additions & 18 deletions .github/workflows/tests.yml → .github/workflows/run-e2e-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Tests e2e

on:
pull_request:
Expand All @@ -16,34 +16,24 @@ jobs:
postgres:
image: bitnami/postgresql
ports:
- 5432:5432
- "5432:5432"
env:
POSTGRESQL_USERNAME: docker
POSTGRESQL_PASSWORD: docker
POSTGRES_USER: docker
POSTGRES_PASSWORD: docker
POSTGRES_DB: api-findAFriend

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

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22.16.0

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.11.1
run_install: false

- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Node and PNPM
uses: ./.github/actions/setup-node-pnpm

- name: Prisma Generate
run: pnpm db:generate

- name: Run tests
run: pnpm test
run: pnpm test:e2e
env:
JWT_SECRET: testing
DATABASE_URL: "postgresql://docker:docker@localhost:5432/api-findAFriend?schema=public"
20 changes: 20 additions & 0 deletions .github/workflows/run-unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Tests unit

on: [push]

jobs:
run-ci:
runs-on: ubuntu-latest

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

- name: Setup Node ande PNPM
uses: ./.github/actions/setup-node-pnpm

- name: Runing prisma generate
run: pnpm db:generate

- name: Run tests
run: pnpm test:unit
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"check": "biome check",
"format": "biome format",
"lint": "biome lint",
"test": "vitest run",
"test:watch": "vitest",
"test:unit": "vitest run --project unit",
"test:unit:watch": "vitest --project unit",
"test:e2e": "vitest run --project e2e",
"test:e2e:watch": "vitest --project e2e",
"test:coverage": "vitest run --coverage",
"test:ui": "vitest --ui",
"db:generate": "prisma generate",
Expand All @@ -35,12 +37,16 @@
"@biomejs/biome": "2.1.1",
"@faker-js/faker": "^9.9.0",
"@types/node": "^24.0.4",
"@types/supertest": "^6.0.3",
"@vitest/coverage-v8": "3.2.4",
"@vitest/ui": "3.2.4",
"dotenv": "^17.2.0",
"prisma": "^6.10.1",
"supertest": "^7.1.3",
"tsup": "^8.5.0",
"tsx": "^4.20.3",
"typescript": "^5.8.3",
"vite": "^7.0.4",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.2.4"
},
Expand Down
Loading