-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (70 loc) · 2.17 KB
/
test.yml
File metadata and controls
86 lines (70 loc) · 2.17 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
83
84
85
name: Node.js Tests
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
# Add Redis service for integration tests
services:
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'
registry-url: 'https://registry.npmjs.org' # Added this line
- name: Install dependencies with rollup workaround
run: npm ci --include=optional
continue-on-error: true
id: npm-ci
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Fallback install if npm ci failed
if: steps.npm-ci.outcome == 'failure'
run: |
echo "npm ci failed, applying rollup optional dependency workaround..."
npm cache clean --force
rm -rf node_modules package-lock.json
npm install --include=optional
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Run build
run: npm run build
- name: Run typecheck
run: npm run typecheck
- name: Run lint
run: npm run lint
- name: Verify Rollup installation
run: |
echo "Checking for Rollup platform binaries..."
ls -la node_modules/@rollup/ | grep rollup- || echo "No @rollup packages found in root"
echo "Checking Rollup version..."
npm ls rollup || true
- name: Run tests
run: npm test
- name: Install Redis CLI
run: sudo apt-get update && sudo apt-get install -y redis-tools
- name: Verify Redis is running
run: |
echo "Checking Redis connection..."
redis-cli -h localhost -p 6379 ping
echo "✅ Redis service is healthy and responsive"
echo "Redis info:"
redis-cli -h localhost -p 6379 info server | head -10
- name: Run Redis integration tests
run: npm run test:integration
env:
REDIS_URL: redis://localhost:6379