/ concept-collection / benchcompress
Sign in
concept-collection / benchcompress
benchcompress / .github / workflows / benchmark.yml
61 lines · 1.7 KBBlameHistoryRaw
1name: Run Benchmarks
3on:
4 workflow_dispatch: # Manual trigger
5 push:
6 branches: [ main ] # Run on main branch pushes
8permissions:
9 contents: write
11jobs:
12 benchmark:
13 name: Run Benchmarks
14 runs-on: ubuntu-latest
16 steps:
17 - uses: actions/checkout@v4
19 - name: Set up Python
20 uses: actions/setup-python@v4
21 with:
22 python-version: '3.12'
24 - name: Install package and dependencies
25 run: |
26 cd zia_benchmark
27 pip install -e .
29 - name: Run benchmarks
30 env:
31 MEMOBIN_API_KEY: ${{ secrets.MEMOBIN_API_KEY }}
32 UPLOAD_TO_MEMOBIN: '1'
33 run: |
34 python scripts/run_benchmarks.py
36 - name: Upload benchmark results as artifacts
37 uses: actions/upload-artifact@v4
38 with:
39 name: benchmark-results
40 path: |
41 zia_benchmark/benchmark_results/results.json
43 - name: Configure Git
44 if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
45 run: |
46 git config user.name "GitHub Actions Bot"
47 git config user.email "actions@github.com"
49 - name: Create fresh results branch
50 if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
51 run: |
52 git checkout --orphan benchmark-results
54 - name: Commit benchmark results
55 if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
56 env:
57 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58 run: |
59 git add benchmark_results/
60 git commit -m "Update benchmark results from $(date +'%Y-%m-%d %H:%M:%S') [skip ci]"
61 git push -f https://${GITHUB_TOKEN}@github.com/${{ github.repository }} benchmark-results
moveopenescclose