/ concept-collection / benchcompress
Sign in
concept-collection / benchcompress
benchcompress / .github / workflows / benchmark.yml
73 lines · 2.1 KBBlameHistoryRaw
1name: Run Benchmarks
3# Add concurrency to cancel in-progress jobs
4concurrency:
5 group: ${{ github.workflow }}-${{ github.ref }}
6 cancel-in-progress: true
8on:
9 workflow_dispatch: # Manual trigger
10 push:
11 branches: [ main ] # Run on main branch pushes
13permissions:
14 contents: write
16jobs:
17 benchmark:
18 name: Run Benchmarks
19 runs-on: ubuntu-latest
21 steps:
22 - uses: actions/checkout@v4
24 - name: Set up Python
25 uses: actions/setup-python@v4
26 with:
27 python-version: '3.12'
29 - name: Install package and dependencies
30 run: |
31 cd zia_benchmark
32 pip install -e .
34 - name: Install simple_ans from source for now
35 run: |
36 git clone https://github.com/flatironinstitute/simple_ans.git
37 cd simple_ans
38 pip install -e .
40 - name: Run benchmarks
41 env:
42 MEMOBIN_API_KEY: ${{ secrets.MEMOBIN_API_KEY }}
43 UPLOAD_TO_MEMOBIN: '1'
44 run: |
45 python scripts/run_benchmarks.py
47 - name: Upload benchmark results as artifacts
48 uses: actions/upload-artifact@v4
49 with:
50 name: benchmark-results
51 path: |
52 zia_benchmark/benchmark_results/results.json
54 - name: Configure Git
55 if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
56 run: |
57 git config user.name "GitHub Actions Bot"
58 git config user.email "actions@github.com"
60 - name: Create fresh results branch
61 if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
62 run: |
63 git checkout --orphan benchmark-results
65 - name: Commit benchmark results
66 if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
67 env:
68 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69 run: |
70 # need to force add because it's in the .gitignore
71 git add -f benchmark_results/
72 git commit -m "Update benchmark results from $(date +'%Y-%m-%d %H:%M:%S') [skip ci]"
73 git push -f https://${GITHUB_TOKEN}@github.com/${{ github.repository }} benchmark-results
moveopenescclose