Skip to content

Commit 7e1151b

Browse files
Update ci.yml
1 parent f4530fe commit 7e1151b

File tree

1 file changed

+95
-114
lines changed

1 file changed

+95
-114
lines changed

.github/workflows/ci.yml

Lines changed: 95 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -11,142 +11,123 @@ on:
1111
jobs:
1212
test:
1313
runs-on: ubuntu-latest
14-
1514
strategy:
1615
matrix:
1716
node-version: [18.x, 20.x]
18-
1917
steps:
20-
- uses: actions/checkout@v4
21-
22-
- name: Use Node.js ${{ matrix.node-version }}
23-
uses: actions/setup-node@v4
24-
with:
25-
node-version: ${{ matrix.node-version }}
26-
cache: 'npm'
27-
28-
- name: Install dependencies
29-
run: npm ci
30-
31-
- name: Run linting
32-
run: npm run lint
33-
34-
- name: Run tests
35-
run: npm test
36-
37-
- name: Build project
38-
run: npm run build:examples
39-
40-
- name: Run sync features check
41-
run: npm run sync-features
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Use Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
- name: Install dependencies
27+
run: npm ci
28+
- name: Run linting
29+
run: npm run lint
30+
- name: Run tests
31+
run: npm test
32+
- name: Build project
33+
run: npm run build:examples
34+
- name: Run sync features check
35+
run: npm run sync-features
4236

4337
build:
4438
needs: test
4539
runs-on: ubuntu-latest
4640
if: github.event_name == 'release' || (github.ref == 'refs/heads/main' && github.event_name == 'push')
47-
4841
steps:
49-
- uses: actions/checkout@v4
50-
51-
- name: Use Node.js 20.x
52-
uses: actions/setup-node@v4
53-
with:
54-
node-version: '20.x'
55-
cache: 'npm'
56-
registry-url: 'https://registry.npmjs.org'
57-
58-
- name: Install dependencies
59-
run: npm ci
60-
61-
- name: Run full test suite
62-
run: npm test
63-
64-
- name: Build project
65-
run: npm run build:examples
66-
67-
- name: Verify build output
68-
run: |
69-
ls -la dist/
70-
ls -la dist/example/
71-
node -e "import('./dist/index.js').then(() => console.log('✅ Main SDK imports successfully'))"
72-
73-
- name: Test example scripts
74-
run: |
75-
echo "Testing compiled examples..."
76-
node -e "import('./dist/example/comprehensive-demo.js').then(() => console.log('✅ Comprehensive demo imports successfully'))"
77-
node -e "import('./dist/example/run-agent.js').then(() => console.log('✅ Run agent imports successfully'))"
78-
node -e "import('./dist/example/advanced-usage.js').then(() => console.log('✅ Advanced usage imports successfully'))"
42+
- uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0
45+
- name: Use Node.js 20.x
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: '20.x'
49+
cache: 'npm'
50+
registry-url: 'https://registry.npmjs.org'
51+
- name: Install dependencies
52+
run: npm ci
53+
- name: Run full test suite
54+
run: npm test
55+
- name: Build project
56+
run: npm run build:examples
57+
- name: Verify build output
58+
run: |
59+
ls -la dist/
60+
ls -la dist/example/
61+
node -e "import('./dist/index.js').then(() => console.log('✅ Main SDK imports successfully'))"
62+
- name: Test example scripts
63+
run: |
64+
echo "Testing compiled examples..."
65+
node -e "import('./dist/example/comprehensive-demo.js').then(() => console.log('✅ Comprehensive demo imports successfully'))"
66+
node -e "import('./dist/example/run-agent.js').then(() => console.log('✅ Run agent imports successfully'))"
67+
node -e "import('./dist/example/advanced-usage.js').then(() => console.log('✅ Advanced usage imports successfully'))"
7968
8069
publish:
8170
needs: build
8271
runs-on: ubuntu-latest
8372
if: github.event_name == 'release'
84-
8573
steps:
86-
- uses: actions/checkout@v4
87-
88-
- name: Use Node.js 20.x
89-
uses: actions/setup-node@v4
90-
with:
91-
node-version: '20.x'
92-
cache: 'npm'
93-
registry-url: 'https://registry.npmjs.org'
94-
95-
- name: Install dependencies
96-
run: npm ci
97-
98-
- name: Build project
99-
run: npm run build:examples
100-
101-
- name: Publish to npm
102-
run: npm publish
103-
env:
104-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
74+
- uses: actions/checkout@v4
75+
with:
76+
fetch-depth: 0
77+
- name: Use Node.js 20.x
78+
uses: actions/setup-node@v4
79+
with:
80+
node-version: '20.x'
81+
cache: 'npm'
82+
registry-url: 'https://registry.npmjs.org'
83+
always-auth: true
84+
- name: Install dependencies
85+
run: npm ci
86+
- name: Build project
87+
run: npm run build:examples
88+
- name: Publish to npm
89+
run: npm publish
90+
env:
91+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
10592

10693
security:
10794
runs-on: ubuntu-latest
108-
10995
steps:
110-
- uses: actions/checkout@v4
111-
112-
- name: Use Node.js 20.x
113-
uses: actions/setup-node@v4
114-
with:
115-
node-version: '20.x'
116-
cache: 'npm'
117-
118-
- name: Install dependencies
119-
run: npm ci
120-
121-
- name: Run security audit
122-
run: npm audit --audit-level=moderate
123-
124-
- name: Check for vulnerabilities
125-
run: npm audit --audit-level=high
126-
continue-on-error: true
96+
- uses: actions/checkout@v4
97+
with:
98+
fetch-depth: 0
99+
- name: Use Node.js 20.x
100+
uses: actions/setup-node@v4
101+
with:
102+
node-version: '20.x'
103+
cache: 'npm'
104+
- name: Install dependencies
105+
run: npm ci
106+
- name: Run security audit (moderate)
107+
run: npm audit --audit-level=moderate
108+
- name: Check for vulnerabilities (high)
109+
run: npm audit --audit-level=high
110+
continue-on-error: true
127111

128112
documentation:
129113
needs: test
130114
runs-on: ubuntu-latest
131-
if: github.ref == 'refs/heads/main'
132-
115+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
133116
steps:
134-
- uses: actions/checkout@v4
135-
136-
- name: Use Node.js 20.x
137-
uses: actions/setup-node@v4
138-
with:
139-
node-version: '20.x'
140-
cache: 'npm'
141-
142-
- name: Install dependencies
143-
run: npm ci
144-
145-
- name: Generate feature sync report
146-
run: npm run sync-features
147-
148-
- name: Upload feature sync report
149-
uses: actions/upload-artifact@v4
150-
with:
151-
name: feature-sync-report
152-
path: feature-sync-report.json
117+
- uses: actions/checkout@v4
118+
with:
119+
fetch-depth: 0
120+
- name: Use Node.js 20.x
121+
uses: actions/setup-node@v4
122+
with:
123+
node-version: '20.x'
124+
cache: 'npm'
125+
- name: Install dependencies
126+
run: npm ci
127+
- name: Generate feature sync report
128+
run: npm run sync-features
129+
- name: Upload feature sync report
130+
uses: actions/upload-artifact@v4
131+
with:
132+
name: feature-sync-report
133+
path: feature-sync-report.json

0 commit comments

Comments
 (0)