-
Notifications
You must be signed in to change notification settings - Fork 173
82 lines (70 loc) · 1.98 KB
/
Copy pathbackend-integration-tests.yml
File metadata and controls
82 lines (70 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Backend Integration Tests
on:
push:
branches: [main, develop]
paths:
- 'backend/**'
- '.github/workflows/backend-integration-tests.yml'
pull_request:
branches: [main, develop]
paths:
- 'backend/**'
jobs:
integration-tests:
runs-on: ubuntu-latest
name: Integration Tests
strategy:
matrix:
node-version: [18.x, 20.x]
fail-fast: false
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'
cache-dependency-path: 'backend/package-lock.json'
- name: Install dependencies
run: |
cd backend
npm ci
- name: Run integration tests
run: |
cd backend
npm test
env:
NODE_ENV: test
DB_PATH: /tmp/stellar-goal-vault-test.db
- name: Generate coverage report
run: |
cd backend
npm test -- --coverage
if: always()
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./backend/coverage/coverage-final.json
flags: backend
name: backend-coverage
if: always()
- name: Clean up test databases
run: |
rm -f /tmp/stellar-goal-vault-*.db
if: always()
test-results:
runs-on: ubuntu-latest
name: Test Results Summary
needs: integration-tests
if: always()
steps:
- name: Test Status
run: |
if [ "${{ needs.integration-tests.result }}" == "success" ]; then
echo "✅ All integration tests passed"
exit 0
else
echo "❌ Integration tests failed"
exit 1
fi