File tree Expand file tree Collapse file tree 2 files changed +82
-0
lines changed
Expand file tree Collapse file tree 2 files changed +82
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Backend Tests
2+
3+ on :
4+ pull_request :
5+ branches : [ main ]
6+ paths :
7+ - ' backend/**'
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+ defaults :
13+ run :
14+ working-directory : ./backend
15+
16+ steps :
17+ - uses : actions/checkout@v3
18+
19+ - name : Set up Node.js
20+ uses : actions/setup-node@v3
21+ with :
22+ node-version : ' 18'
23+ cache : ' npm'
24+ cache-dependency-path : ' ./backend/package-lock.json'
25+
26+ - name : Install dependencies
27+ run : npm ci
28+
29+ - name : Run linting
30+ run : npm run lint
31+
32+ - name : Run tests
33+ run : npm test
34+
35+ - name : Generate test summary
36+ if : always()
37+ run : |
38+ echo "# Backend Test Results" >> $GITHUB_STEP_SUMMARY
39+ if [ ${{ job.status }} == "success" ]; then
40+ echo "✅ All tests passed successfully!" >> $GITHUB_STEP_SUMMARY
41+ else
42+ echo "❌ Some tests failed. Please check the logs for details." >> $GITHUB_STEP_SUMMARY
43+ fi
Original file line number Diff line number Diff line change 1+ name : Frontend Tests
2+
3+ on :
4+ pull_request :
5+ branches : [ main ]
6+ paths :
7+ - ' frontend/**'
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+ defaults :
13+ run :
14+ working-directory : ./frontend
15+
16+ steps :
17+ - uses : actions/checkout@v3
18+
19+ - name : Set up Node.js
20+ uses : actions/setup-node@v3
21+ with :
22+ node-version : ' 18'
23+ cache : ' npm'
24+ cache-dependency-path : ' ./frontend/package-lock.json'
25+
26+ - name : Install dependencies
27+ run : npm ci
28+
29+ - name : Run tests
30+ run : npm test
31+
32+ - name : Generate test summary
33+ if : always()
34+ run : |
35+ echo "# Frontend Test Results" >> $GITHUB_STEP_SUMMARY
36+ if [ ${{ job.status }} == "success" ]; then
37+ echo "✅ All tests passed successfully!" >> $GITHUB_STEP_SUMMARY
38+ else
39+ echo "❌ Some tests failed. Please check the logs for details." >> $GITHUB_STEP_SUMMARY
You can’t perform that action at this time.
0 commit comments