Skip to content

Grainchain Benchmarks #49

Grainchain Benchmarks

Grainchain Benchmarks #49

Workflow file for this run

name: Outline Benchmarks
on:
schedule:
# Run benchmarks daily at 2 AM UTC
- cron: '0 2 * * *'
workflow_dispatch:
# Allow manual triggering
push:
branches:
- main
paths:
- 'benchmarks/**'
- '.github/workflows/benchmark.yml'
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Configure Git
run: |
git config --global user.name "Benchmark Bot"
git config --global user.email "benchmark@grainchain.dev"
- name: Run benchmarks
run: |
python benchmarks/scripts/auto_publish.py --run-benchmark
env:
DOCKER_HOST: unix:///var/run/docker.sock
- name: Generate summary report
run: |
python benchmarks/scripts/auto_publish.py --generate-summary
- name: Commit and push results
run: |
git add benchmarks/results/
if ! git diff --cached --quiet; then
git commit -m "📊 Automated benchmark results - $(date '+%Y-%m-%d %H:%M:%S')"
git push
else
echo "No new benchmark results to commit"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload benchmark artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: benchmark-results
path: benchmarks/results/
retention-days: 30