Skip to content

Commit

Permalink
CI: add benchmark and generating benchmark image
Browse files Browse the repository at this point in the history
  • Loading branch information
deedy5 committed May 1, 2024
1 parent b6ddeb7 commit 0c906ef
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,34 @@ jobs:
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*

benchmark:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r benchmark/requirements.txt
- name: Start Uvicorn server
run: |
uvicorn benchmark.server:app --host 0.0.0.0 --port 8000 &
sleep 10
- name: Run benchmark
run: python benchmark/benchmark.py
- name: Generate image and commit
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
run: |
python benchmark/generate_image.py
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git add \*.jpg
git commit -m "Update generated image" || echo "No changes to commit"
git pull origin benchmark --allow-unrelated-histories || echo "No changes to pull"
git push https://${{ secrets.PUSH_TOKEN }}@github.com/${{ github.repository }}

0 comments on commit 0c906ef

Please sign in to comment.