workflow updates for backend
This commit is contained in:
@@ -16,6 +16,9 @@ jobs:
|
|||||||
echo "Code already available in workspace"
|
echo "Code already available in workspace"
|
||||||
pwd
|
pwd
|
||||||
ls -la
|
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
|
- name: Check Node.js version
|
||||||
run: |
|
run: |
|
||||||
@@ -26,8 +29,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Install backend dependencies
|
- name: Install backend dependencies
|
||||||
run: |
|
run: |
|
||||||
|
if [ -d "backend" ]; then
|
||||||
cd backend
|
cd backend
|
||||||
npm ci
|
npm ci
|
||||||
|
else
|
||||||
|
echo "Backend directory not found, skipping backend dependencies"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Run backend tests
|
- name: Run backend tests
|
||||||
env:
|
env:
|
||||||
@@ -35,23 +43,43 @@ jobs:
|
|||||||
JWT_SECRET: test-secret-key-for-ci
|
JWT_SECRET: test-secret-key-for-ci
|
||||||
NODE_ENV: test
|
NODE_ENV: test
|
||||||
run: |
|
run: |
|
||||||
|
if [ -d "backend" ]; then
|
||||||
cd backend
|
cd backend
|
||||||
npm run test
|
npm run test
|
||||||
|
else
|
||||||
|
echo "Backend directory not found, skipping backend tests"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Install frontend dependencies
|
- name: Install frontend dependencies
|
||||||
run: |
|
run: |
|
||||||
|
if [ -d "frontend" ]; then
|
||||||
cd frontend
|
cd frontend
|
||||||
npm ci
|
npm ci
|
||||||
|
else
|
||||||
|
echo "Frontend directory not found, skipping frontend dependencies"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Run frontend tests
|
- name: Run frontend tests
|
||||||
run: |
|
run: |
|
||||||
|
if [ -d "frontend" ]; then
|
||||||
cd frontend
|
cd frontend
|
||||||
npm run test
|
npm run test
|
||||||
|
else
|
||||||
|
echo "Frontend directory not found, skipping frontend tests"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Build frontend
|
- name: Build frontend
|
||||||
run: |
|
run: |
|
||||||
|
if [ -d "frontend" ]; then
|
||||||
cd frontend
|
cd frontend
|
||||||
npm run build
|
npm run build
|
||||||
|
else
|
||||||
|
echo "Frontend directory not found, skipping frontend build"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
needs: test
|
needs: test
|
||||||
|
|||||||
@@ -63,3 +63,6 @@ temp/
|
|||||||
*.local
|
*.local
|
||||||
CODE_STRUCTURE.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