/ concept-collection / benchcompress
Sign in
concept-collection / benchcompress
benchcompress / .github / workflows / benchmark.yml
67 lines · 1.9 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: Install simple_ans from source for now
30 run: |
31 git clone https://github.com/flatironinstitute/simple_ans.git
32 cd simple_ans
33 pip install -e .
35 - name: Run benchmarks
36 env:
37 MEMOBIN_API_KEY: ${{ secrets.MEMOBIN_API_KEY }}
38 UPLOAD_TO_MEMOBIN: '1'
39 run: |
40 python scripts/run_benchmarks.py
42 - name: Upload benchmark results as artifacts
43 uses: actions/upload-artifact@v4
44 with:
45 name: benchmark-results
46 path: |
47 zia_benchmark/benchmark_results/results.json
49 - name: Configure Git
50 if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
51 run: |
52 git config user.name "GitHub Actions Bot"
53 git config user.email "actions@github.com"
55 - name: Create fresh results branch
56 if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
57 run: |
58 git checkout --orphan benchmark-results
60 - name: Commit benchmark results
61 if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
62 env:
63 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64 run: |
65 git add benchmark_results/
66 git commit -m "Update benchmark results from $(date +'%Y-%m-%d %H:%M:%S') [skip ci]"
67 git push -f https://${GITHUB_TOKEN}@github.com/${{ github.repository }} benchmark-results
moveopenescclose