Performance Tests #24
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: Performance Tests | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| schedule: | |
| # Run weekly on Sunday at midnight | |
| - cron: '0 0 * * 0' | |
| workflow_dispatch: | |
| jobs: | |
| performance-benchmarks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Emacs | |
| uses: purcell/setup-emacs@master | |
| with: | |
| version: '29.1' | |
| - name: Setup Cask | |
| uses: conao3/setup-cask@master | |
| with: | |
| version: snapshot | |
| - name: Install dependencies | |
| run: cask install | |
| - name: Run all performance benchmarks | |
| run: | | |
| chmod +x .github/scripts/run-performance-tests.sh | |
| .github/scripts/run-performance-tests.sh | |
| env: | |
| PERFORMANCE_THRESHOLD: "5.0" | |
| continue-on-error: true | |
| - name: Load time test | |
| run: | | |
| time cask emacs --batch -L . \ | |
| --eval "(require 'aichat)" \ | |
| --eval "(require 'skintwin)" \ | |
| --eval "(message \"Load time test complete\")" | |
| - name: Org-mode parsing performance | |
| run: | | |
| cask emacs --batch -L . \ | |
| --eval "(require 'aichat-opencog-org)" \ | |
| --eval "(find-file \"skintwin.org\")" \ | |
| --eval "(benchmark-run 5 \ | |
| (org-mode) \ | |
| (goto-char (point-min)) \ | |
| (org-map-entries (lambda () (org-entry-get nil \"ITEM\"))))" \ | |
| --eval "(message \"Org parsing benchmark complete\")" | |
| continue-on-error: true | |
| javascript-performance: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run build | |
| - name: Measure build time | |
| run: | | |
| echo "Measuring build performance..." | |
| time npm run build | |
| - name: Check bundle size | |
| run: | | |
| if [ -d "dist" ]; then | |
| echo "Bundle size analysis:" | |
| du -sh dist/ | |
| du -sh dist/assets/* || true | |
| fi | |
| regression-detection: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout current code | |
| uses: actions/checkout@v4 | |
| - name: Setup Emacs | |
| uses: purcell/setup-emacs@master | |
| with: | |
| version: '29.1' | |
| - name: Setup Cask | |
| uses: conao3/setup-cask@master | |
| with: | |
| version: snapshot | |
| - name: Install dependencies | |
| run: cask install | |
| - name: Run baseline performance tests | |
| run: | | |
| chmod +x .github/scripts/run-performance-tests.sh | |
| .github/scripts/run-performance-tests.sh | |
| env: | |
| PERFORMANCE_THRESHOLD: "5.0" | |
| continue-on-error: true | |
| - name: Generate performance report | |
| run: | | |
| echo "# Performance Test Report" > performance-report.md | |
| echo "" >> performance-report.md | |
| echo "## Test Date: $(date)" >> performance-report.md | |
| echo "" >> performance-report.md | |
| echo "## Results" >> performance-report.md | |
| echo "- All performance tests completed" >> performance-report.md | |
| echo "- See job logs for detailed metrics" >> performance-report.md | |
| - name: Upload performance report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: performance-report | |
| path: performance-report.md | |
| retention-days: 90 |