77 branches : [ main ]
88
99jobs :
10- security_test :
11- runs-on : ubuntu-latest
12- steps :
13- - uses : actions/checkout@v3
14- - name : Set up Node.js
15- uses : actions/setup-node@v3
16- with :
17- node-version : ' 16'
18- cache : ' npm'
19- - name : Install dependencies
20- run : npm ci
21- - name : Run security tests
22- run : node tests/run-tests.js security
23-
24- json_parsing_test :
25- runs-on : ubuntu-latest
26- steps :
27- - uses : actions/checkout@v3
28- - name : Set up Node.js
29- uses : actions/setup-node@v3
30- with :
31- node-version : ' 16'
32- cache : ' npm'
33- - name : Install dependencies
34- run : npm ci
35- - name : Test JSON parsing error handling
36- run : |
37- # Create test script
38- echo "
39- /**
40- * Simple JSON Parsing Test
41- */
42-
43- const { safeJsonParse } = require('./lib/utils/security-middleware');
44- const { formatJsonResult } = require('./lib/utils/structured-output');
45-
46- let allTestsPassed = true;
47- let testsRun = 0;
48-
49- function runTest(name, testFn) {
50- testsRun++;
51- console.log(\`\n=== Testing \${name} ===\`);
52- try {
53- const passed = testFn();
54- console.log(\`Test passed: \${passed}\`);
55- if (!passed) allTestsPassed = false;
56- return passed;
57- } catch (error) {
58- console.error(\`Test failed: \${error.message}\`);
59- allTestsPassed = false;
60- return false;
61- }
62- }
63-
64- // Test valid JSON
65- runTest('Valid JSON', () => {
66- const validJson = '{\"name\":\"test\",\"value\":42}';
67- const validResult = safeJsonParse(validJson);
68- return validResult.name === 'test' && validResult.value === 42;
69- });
70-
71- // Test empty string
72- runTest('Empty String', () => {
73- const emptyResult = safeJsonParse('', { default: true });
74- return emptyResult.default === true;
75- });
76-
77- // Test malformed JSON
78- runTest('Malformed JSON', () => {
79- const malformedJson = '{name: \"test\"}';
80- const malformedResult = safeJsonParse(malformedJson, { default: true });
81- return malformedResult.default === true;
82- });
83-
84- // Test non-string input
85- runTest('Non-String Input', () => {
86- const nullResult = safeJsonParse(null, { default: true });
87- return nullResult.default === true;
88- });
89-
90- // Test circular references
91- runTest('Circular References', () => {
92- const obj = { name: 'circular' };
93- obj.self = obj; // Create circular reference
94- const circularResult = formatJsonResult(obj);
95- return circularResult.success === true &&
96- circularResult.data.name === 'circular' &&
97- typeof circularResult.data.self === 'string';
98- });
99-
100- console.log(\`\n=== Testing Complete ===\`);
101- console.log(\`\${testsRun} tests run, all tests passed: \${allTestsPassed}\`);
102-
103- process.exit(allTestsPassed ? 0 : 1);
104- " > json-parsing-test.js
105-
106- # Run the test
107- node json-parsing-test.js
108-
10910 unit_test :
11011 runs-on : ubuntu-latest
111- needs : [security_test, json_parsing_test]
11212 steps :
11313 - uses : actions/checkout@v3
11414 - name : Set up Node.js
@@ -119,11 +19,10 @@ jobs:
11919 - name : Install dependencies
12020 run : npm ci
12121 - name : Run unit tests
122- run : node tests/run-tests.js unit
22+ run : npm test
12323
124- integration_test :
24+ lint_check :
12525 runs-on : ubuntu-latest
126- needs : unit_test
12726 steps :
12827 - uses : actions/checkout@v3
12928 - name : Set up Node.js
@@ -133,12 +32,12 @@ jobs:
13332 cache : ' npm'
13433 - name : Install dependencies
13534 run : npm ci
136- - name : Run integration tests
137- run : node tests/ run-tests.js integration
35+ - name : Run lint check
36+ run : npm run lint:check
13837
139- performance_test :
38+ cli_test :
14039 runs-on : ubuntu-latest
141- needs : integration_test
40+ needs : unit_test
14241 steps :
14342 - uses : actions/checkout@v3
14443 - name : Set up Node.js
@@ -148,8 +47,29 @@ jobs:
14847 cache : ' npm'
14948 - name : Install dependencies
15049 run : npm ci
151- - name : Run performance tests
152- run : node tests/run-tests.js performance
50+ - name : Test CLI commands
51+ run : |
52+ # Initialize TaskTracker
53+ node bin/tt init
54+
55+ # Test journal commands
56+ node bin/tt j "Test journal entry"
57+ node bin/tt j "Test decision" --type decision
58+ node bin/tt j "Test with tags" --tags test,ci
59+
60+ # Test context generation
61+ node bin/tt c
62+ node bin/tt cf 1
63+
64+ # Test PRD commands
65+ node bin/tt prd "Test project requirements"
66+ node bin/tt prd-show
67+
68+ # Test journal show
69+ node bin/tt journal-show
70+ node bin/tt journal-show --type decision
71+
72+ echo "✅ All CLI commands executed successfully"
15373
15474 documentation_check :
15575 runs-on : ubuntu-latest
@@ -158,50 +78,19 @@ jobs:
15878 - name : Check documentation structure
15979 run : |
16080 # Verify main documentation files exist
161- for dir in docs/user-guides docs/dev-reference docs/ai-integration; do
162- if [ ! -f "$dir/README.md" ]; then
163- echo "Missing README.md in $dir"
164- exit 1
165- fi
166- done
167-
168- # Verify architecture documentation exists
169- if [ ! -f "docs/dev-docs/ARCHITECTURE.md" ]; then
170- echo "Missing architecture documentation"
81+ if [ ! -f "README.md" ]; then
82+ echo "Missing README.md"
17183 exit 1
17284 fi
17385
174- # Verify CLI reference exists
175- if [ ! -f "docs/dev-reference/cli-reference.md " ]; then
176- echo "Missing CLI reference documentation "
86+ # Check for package.json
87+ if [ ! -f "package.json " ]; then
88+ echo "Missing package.json "
17789 exit 1
17890 fi
17991
18092 echo "✅ Documentation structure verified"
18193
182- template_check :
183- runs-on : ubuntu-latest
184- steps :
185- - uses : actions/checkout@v3
186- - name : Check for templates
187- run : |
188- # Ensure Claude templates exist
189- if [ ! -d "docs/dev-docs/claude-templates" ]; then
190- echo "Claude templates directory not found"
191- exit 1
192- fi
193-
194- # Check for required template files
195- required_templates=("daily-update.txt" "task-create.txt" "pr-prepare.txt")
196- for template in "${required_templates[@]}"; do
197- if [ ! -f "docs/dev-docs/claude-templates/$template" ]; then
198- echo "Template file $template not found"
199- exit 1
200- fi
201- done
202-
203- echo "✅ All required templates found"
204-
20594 structure_check :
20695 runs-on : ubuntu-latest
20796 steps :
@@ -223,18 +112,21 @@ jobs:
223112 fi
224113
225114 # Check for core modules
226- core_modules=("task-manager.js" " config-manager.js" "formatting.js" "cli-parser.js")
115+ core_modules=("unified- config-manager.js" "formatting.js" "cli-parser.js" "command-registry .js")
227116 for module in "${core_modules[@]}"; do
228117 if [ ! -f "lib/core/$module" ]; then
229118 echo "Missing core module: $module"
230119 exit 1
231120 fi
232121 done
233122
234- # Verify monolithic script is gone
235- if [ -f "lib/core/tasktracker.js" ]; then
236- echo "Error: Monolithic script still exists"
237- exit 1
238- fi
123+ # Check for main commands
124+ commands=("journal.js" "prd.js" "context.js" "context-v2.js" "help.js" "init.js")
125+ for cmd in "${commands[@]}"; do
126+ if [ ! -f "lib/commands/$cmd" ]; then
127+ echo "Missing command: $cmd"
128+ exit 1
129+ fi
130+ done
239131
240132 echo "✅ Repository structure verified"
0 commit comments