- Add specific removal of problematic container afa9a70588844b06e17d5e0527119d589a7a3fde8a17608447cf7d8d448cf261 - Force remove portfolio-app-new container before deployment - Add container listing for debugging after cleanup - Upgrade setup-node to v4 for better performance - Add cache-dependency-path for more efficient caching - Create fast workflow alternative with manual cache management
41 lines
863 B
YAML
41 lines
863 B
YAML
name: Test and Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
env:
|
|
NODE_VERSION: '20'
|
|
|
|
jobs:
|
|
test-and-build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
cache: 'npm'
|
|
cache-dependency-path: 'package-lock.json'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run linting
|
|
run: npm run lint
|
|
|
|
- name: Run tests
|
|
run: npm run test
|
|
|
|
- name: Build application
|
|
run: npm run build
|
|
|
|
- name: Run security scan
|
|
run: |
|
|
echo "🔍 Running npm audit..."
|
|
npm audit --audit-level=high || echo "⚠️ Some vulnerabilities found, but continuing..." |