-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (63 loc) · 2.51 KB
/
Copy pathci.yml
File metadata and controls
79 lines (63 loc) · 2.51 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
name: CI - Build & Test
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
build:
runs-on: ubuntu-latest
name: Build & Test
strategy:
matrix:
node-version: [20.x, 22.x]
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 }}
- name: Install dependencies
run: npm ci
- name: Build TypeScript
run: npm run build
- name: Check build output
run: |
echo "✓ Checking dist/index.js..."
test -f dist/index.js && echo " Found" || (echo " Missing!" && exit 1)
echo "✓ Checking dist/index.d.ts..."
test -f dist/index.d.ts && echo " Found" || (echo " Missing!" && exit 1)
echo "✓ Checking dist/cli/index.js..."
test -f dist/cli/index.js && echo " Found" || (echo " Missing!" && exit 1)
echo "✓ Checking dist/core/parser.js..."
test -f dist/core/parser.js && echo " Found" || (echo " Missing!" && exit 1)
echo "✓ Checking dist/core/client.js..."
test -f dist/core/client.js && echo " Found" || (echo " Missing!" && exit 1)
- name: Verify CLI works
run: |
echo "Testing CLI with --help..."
node dist/cli/index.js --help | head -5
- name: Check package.json validity
run: |
node -e "
const pkg = require('./package.json');
console.log('Package: ' + pkg.name);
console.log('Version: ' + pkg.version);
console.log('Type: ' + pkg.type);
console.log('Main: ' + pkg.main);
console.log('Bin: ' + pkg.bin['hixbe-time']);
if (!pkg.name.includes('@hixbe/time')) {
console.error('Invalid package name');
process.exit(1);
}
"
- name: Verify TypeScript types
run: |
echo "Checking TypeScript declarations..."
test -f dist/index.d.ts && echo "✓ Main types" || exit 1
test -f dist/core/parser.d.ts && echo "✓ Parser types" || exit 1
test -f dist/core/client.d.ts && echo "✓ Client types" || exit 1
test -f dist/cli/index.d.ts && echo "✓ CLI types" || exit 1
- name: Build Success
run: echo "✅ Build successful on Node.js ${{ matrix.node-version }}"