Grainchain Benchmarks #49
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: 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 |