From 58aceb460433dcd0b4735aaf1567f15abf75689b Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 16:24:36 +0000 Subject: [PATCH 1/2] ci: add CI/CD pipeline for backend and frontend - Trigger on push to main and PRs to main - Matrix strategy testing on Node 18 and Node 20 - Backend: install deps, run tests with coverage, security audit - Frontend: install deps, ESLint linting, production build, security audit - Upload backend test coverage as build artifact --- .github/workflows/ci-cd.yml | 80 +++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/ci-cd.yml diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 00000000..df0ed082 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,80 @@ +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 + 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 + run: npm audit --audit-level=moderate From 9a14e6f1606bace95b3ef8bd25ec5b2d39409368 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 16:26:45 +0000 Subject: [PATCH 2/2] ci: use continue-on-error for npm audit steps Pre-existing vulnerabilities in both backend and frontend dependencies cause npm audit to exit non-zero. Use continue-on-error so the audit surfaces findings without blocking the pipeline. --- .github/workflows/ci-cd.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index df0ed082..509f61c0 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -45,6 +45,7 @@ jobs: - name: Security audit working-directory: backend + continue-on-error: true run: npm audit --audit-level=moderate frontend: @@ -77,4 +78,5 @@ jobs: - name: Security audit working-directory: frontend + continue-on-error: true run: npm audit --audit-level=moderate