Skip to content

Implement comprehensive CI/CD pipeline and project infrastructure #1

Implement comprehensive CI/CD pipeline and project infrastructure

Implement comprehensive CI/CD pipeline and project infrastructure #1

Workflow file for this run

name: CI/CD Pipeline

Check failure on line 1 in .github/workflows/ci-cd.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci-cd.yml

Invalid workflow file

(Line: 30, Col: 14): Unexpected symbol: '"**/package-lock'. Located at position 11 within expression: hashFiles("**/package-lock.json")
on:
push:
branches: [ leader, main ]
pull_request:
branches: [ leader, main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
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 }}
cache: "npm"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles("**/package-lock.json") }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
- name: Check formatting
run: npm run format:check
- name: Run unit tests
run: npm run test:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
- name: Build application
run: npm run build
- name: Run visual regression tests
run: npm run test:visual
- name: Upload test artifacts
uses: actions/upload-artifact@v3
if: failure()
with:
name: test-artifacts
path: |
tests/playwright/screenshots/
tests/playwright/test-results/
security:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Run security audit
run: npm audit --audit-level=high
- name: Run custom security scan
run: ./scripts/security-audit.sh || true
deploy:
needs: [test, security]
runs-on: ubuntu-latest
if: github.ref == "refs/heads/leader" && github.event_name == "push"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build for production
run: npm run build
- name: Deploy notification
run: echo "Deployment would happen here - integrate with your deployment system"