Skip to content
Open
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
82 changes: 82 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI/CD Pipeline

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
backend:
name: Backend (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]

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

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
working-directory: backend
run: npm ci

- name: Run unit tests with coverage
working-directory: backend
run: npm run test:ci

- name: Upload test coverage artifact
if: always() && matrix.node-version == 20
uses: actions/upload-artifact@v4
with:
name: backend-coverage
path: backend/coverage/

- name: Security audit
working-directory: backend
continue-on-error: true
run: npm audit --audit-level=moderate

frontend:
name: Frontend (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]

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

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
working-directory: frontend
run: npm ci

- name: Run ESLint
working-directory: frontend
run: npm run lint

- name: Build production bundle
working-directory: frontend
run: npm run build

- name: Security audit
working-directory: frontend
continue-on-error: true
run: npm audit --audit-level=moderate
Loading