updated all example and sync and test along with npn package #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| release: | |
| types: [ published ] | |
| 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: Run linting | |
| run: npm run lint | |
| - name: Run tests | |
| run: npm test | |
| - name: Build project | |
| run: npm run build:examples | |
| - name: Run sync features check | |
| run: npm run sync-features | |
| build: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' || (github.ref == 'refs/heads/main' && github.event_name == 'push') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run full test suite | |
| run: npm test | |
| - name: Build project | |
| run: npm run build:examples | |
| - name: Verify build output | |
| run: | | |
| ls -la dist/ | |
| ls -la dist/example/ | |
| node -e "import('./dist/index.js').then(() => console.log('✅ Main SDK imports successfully'))" | |
| - name: Test example scripts | |
| run: | | |
| echo "Testing compiled examples..." | |
| node -e "import('./dist/example/comprehensive-demo.js').then(() => console.log('✅ Comprehensive demo imports successfully'))" | |
| node -e "import('./dist/example/run-agent.js').then(() => console.log('✅ Run agent imports successfully'))" | |
| node -e "import('./dist/example/advanced-usage.js').then(() => console.log('✅ Advanced usage imports successfully'))" | |
| publish: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run build:examples | |
| - name: Publish to npm | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| security: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run security audit | |
| run: npm audit --audit-level=moderate | |
| - name: Check for vulnerabilities | |
| run: npm audit --audit-level=high | |
| continue-on-error: true | |
| documentation: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20.x' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate feature sync report | |
| run: npm run sync-features | |
| - name: Upload feature sync report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: feature-sync-report | |
| path: feature-sync-report.json |