-
Notifications
You must be signed in to change notification settings - Fork 0
126 lines (102 loc) · 3.01 KB
/
Copy pathtest-shared-context.yml
File metadata and controls
126 lines (102 loc) · 3.01 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Test Shared Context
on:
push:
paths:
- 'src/core/context/**'
- 'src/core/session/**'
- 'src/cli/**'
- '.github/workflows/test-shared-context.yml'
pull_request:
paths:
- 'src/core/context/**'
- 'src/core/session/**'
- 'src/cli/**'
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Verify dist artifacts
run: npm run verify:dist
- name: Run shared context tests
run: npm run test:shared-context
env:
CI: true
- name: Run all tests
run: npm run test:run
env:
CI: true
- name: Generate coverage (Node 20 only)
if: matrix.node-version == '20.x'
run: npm run test:run -- --coverage
env:
CI: true
- name: Upload coverage reports to Codecov
if: matrix.node-version == '20.x'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage-final.json
flags: unit
fail_ci_if_error: false
verbose: true
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.node-version }}
path: |
coverage/
test-results/
integration:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Verify dist artifacts
run: npm run verify:dist
- name: Test CLI integration
run: |
# Initialize test project
mkdir -p /tmp/test-project
cd /tmp/test-project
npx stackmemory init
# Test status command with shared context
npx stackmemory status
# Create test frames and sync
echo "Testing shared context..." | npx stackmemory context push "Test Frame" --type task
npx stackmemory context add decision "Use shared context for cross-session reference"
# Verify context persistence
npx stackmemory status --project
- name: Verify shared context files
run: |
# Check if shared context directory exists
if [ -d "$HOME/.stackmemory/shared-context" ]; then
echo "✅ Shared context directory exists"
ls -la "$HOME/.stackmemory/shared-context/"
else
echo "❌ Shared context directory not found"
exit 1
fi