Skip to content

Commit

Permalink
ci: add backend pr actions
Browse files Browse the repository at this point in the history
  • Loading branch information
k1eu committed Aug 9, 2024
1 parent 11b8ac7 commit 59eda43
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 1 deletion.
76 changes: 76 additions & 0 deletions .github/workflows/pr-backend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Backend Pull Request Check

on:
pull_request:
branches:
- "*"
paths:
- apps/api/**

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./apps/api/
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4

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

- name: Install dependencies
run: pnpm install

- name: Run ESLint
run: pnpm lint-tsc

build:
name: Build app
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./apps/api/
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4

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

- run: pnpm install
- name: Build the app
run: pnpm run build

test:
name: Jest tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./apps/api/
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4

- name: Start containers
run: docker compose -f "docker-compose.yml" up -d --build

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

- name: Install dependencies
run: pnpm install

- name: Run unit tests
run: pnpm test

- name: Run e2e tests
run: pnpm test:e2e
2 changes: 1 addition & 1 deletion .github/workflows/pr-frontend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Frontend Pull Request Check
on:
pull_request:
branches:
- main
- '*'
paths:
- apps/web/**
jobs:
Expand Down
1 change: 1 addition & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"lint-tsc": "tsc --noEmit && eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
Expand Down

0 comments on commit 59eda43

Please sign in to comment.