Skip to content

Commit

Permalink
ci: set up CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yongjiema committed Feb 20, 2025
1 parent fc7f2f0 commit 500ef86
Show file tree
Hide file tree
Showing 6 changed files with 988 additions and 99 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI Pipeline

on:
push:
branches:
- master
pull_request:

jobs:
test:
name: Run Tests and Linting
runs-on: ubuntu-latest

strategy:
matrix:
project: [backend, frontend]

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

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts'

- name: Install Dependencies
run: npm ci
working-directory: ./${{ matrix.project }}

- name: Lint Code
run: npm run lint
working-directory: ./${{ matrix.project }}

- name: Run Tests
run: npm test
working-directory: ./${{ matrix.project }}
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run check
4 changes: 3 additions & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"check": "npm run lint && npm test",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test": "",
"test:back": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
Expand Down
4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
"start": "refine start",
"start:dev": "npm run dev",
"refine": "refine",
"check": "npm run lint && npm test",
"lint": "eslint . --ext .ts,.tsx",
"format": "prettier --write ."
"format": "prettier --write .",
"test": ""
},
"browserslist": {
"production": [
Expand Down
Loading

0 comments on commit 500ef86

Please sign in to comment.