feat: add RAG (Retrieval-Augmented Generation) module #11
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: Benchmark | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| benchmark: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build | |
| run: npm run build | |
| - name: Run benchmarks | |
| run: npm run bench:ci | |
| - name: Upload benchmark results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-results | |
| path: benchmarks/results/ | |
| - name: Update README with benchmark results | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| run: node scripts/update-readme-benchmarks.js | |
| - name: Commit updated results | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| env: | |
| PAT_TOKEN: ${{ secrets.PAT_TOKEN }} | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git remote set-url origin https://x-access-token:${PAT_TOKEN}@github.com/${{ github.repository }}.git | |
| git add benchmarks/results/ README.md | |
| git diff --staged --quiet || git commit -m "ci: update benchmark results [skip ci]" | |
| git push | |
| - name: Comment benchmark results on PR | |
| if: github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const report = fs.readFileSync('benchmarks/results/BENCHMARK.md', 'utf8'); | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: `## 🚀 Benchmark Results\n\n${report}` | |
| }); |