workflow updates for backend
This commit is contained in:
+38
-10
@@ -16,6 +16,9 @@ jobs:
|
||||
echo "Code already available in workspace"
|
||||
pwd
|
||||
ls -la
|
||||
echo "Checking for backend and frontend directories:"
|
||||
ls -la backend/ 2>/dev/null || echo "backend directory not found"
|
||||
ls -la frontend/ 2>/dev/null || echo "frontend directory not found"
|
||||
|
||||
- name: Check Node.js version
|
||||
run: |
|
||||
@@ -26,8 +29,13 @@ jobs:
|
||||
|
||||
- name: Install backend dependencies
|
||||
run: |
|
||||
cd backend
|
||||
npm ci
|
||||
if [ -d "backend" ]; then
|
||||
cd backend
|
||||
npm ci
|
||||
else
|
||||
echo "Backend directory not found, skipping backend dependencies"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Run backend tests
|
||||
env:
|
||||
@@ -35,23 +43,43 @@ jobs:
|
||||
JWT_SECRET: test-secret-key-for-ci
|
||||
NODE_ENV: test
|
||||
run: |
|
||||
cd backend
|
||||
npm run test
|
||||
if [ -d "backend" ]; then
|
||||
cd backend
|
||||
npm run test
|
||||
else
|
||||
echo "Backend directory not found, skipping backend tests"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Install frontend dependencies
|
||||
run: |
|
||||
cd frontend
|
||||
npm ci
|
||||
if [ -d "frontend" ]; then
|
||||
cd frontend
|
||||
npm ci
|
||||
else
|
||||
echo "Frontend directory not found, skipping frontend dependencies"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Run frontend tests
|
||||
run: |
|
||||
cd frontend
|
||||
npm run test
|
||||
if [ -d "frontend" ]; then
|
||||
cd frontend
|
||||
npm run test
|
||||
else
|
||||
echo "Frontend directory not found, skipping frontend tests"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Build frontend
|
||||
run: |
|
||||
cd frontend
|
||||
npm run build
|
||||
if [ -d "frontend" ]; then
|
||||
cd frontend
|
||||
npm run build
|
||||
else
|
||||
echo "Frontend directory not found, skipping frontend build"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
deploy:
|
||||
needs: test
|
||||
|
||||
+4
-1
@@ -62,4 +62,7 @@ temp/
|
||||
# Local development files (not for public repo)
|
||||
*.local
|
||||
CODE_STRUCTURE.local
|
||||
RESTART_SUMMARY.md
|
||||
RESTART_SUMMARY.md
|
||||
|
||||
# Ignore GitHub workflows when pushing to Gitea
|
||||
.github/
|
||||
Reference in New Issue
Block a user