Update perfhistory.yml #3
Workflow file for this run
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
| #################################################################################### | |
| # Runs benchmarks for BlackSheep source code at various points of the commit history, | |
| # on Ubuntu and Windows for a single version of Python. | |
| # | |
| # This workflow supports both manual and automatic triggers. | |
| # If triggered manually, it is possible to select commits hashes or tags to checkout. | |
| # | |
| # The minimum supported BlackSheep version by the benchmarks is v2.0.1! | |
| #################################################################################### | |
| name: HistoryBenchmark | |
| on: | |
| push: | |
| paths: | |
| - '.github/**' | |
| - 'perf/**' | |
| workflow_dispatch: | |
| inputs: | |
| commits: | |
| description: "List of commits or tags to benchmark (space-separated)" | |
| required: true | |
| default: "v2.0.1 v2.2.0 v2.3.0" | |
| env: | |
| DEFAULT_COMMITS: "v2.0.1 v2.2.0 v2.3.0" | |
| jobs: | |
| perf-tests: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.13"] | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: false | |
| - name: Use Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| pip install -r requirements.txt | |
| pip install flake8 | |
| - name: Compile Cython extensions | |
| run: | | |
| cython blacksheep/url.pyx | |
| cython blacksheep/exceptions.pyx | |
| cython blacksheep/headers.pyx | |
| cython blacksheep/cookies.pyx | |
| cython blacksheep/contents.pyx | |
| cython blacksheep/messages.pyx | |
| cython blacksheep/scribe.pyx | |
| cython blacksheep/baseapp.pyx | |
| python setup.py build_ext --inplace | |
| - name: Install dependencies for benchmark | |
| run: | | |
| cd perf | |
| pip install -r req.txt | |
| - name: Run benchmark | |
| shell: bash | |
| env: | |
| COMMITS: ${{ github.event.inputs.commits || env.DEFAULT_COMMITS }} | |
| run: | | |
| echo "Running benchmarks for commits: $COMMITS" | |
| export PYTHONPATH="." | |
| python perf/historyrun.py --commits $COMMITS --times 3 | |
| - name: Upload results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-results-${{ matrix.os }}-${{ matrix.python-version }} | |
| path: benchmark_results | |
| genreport: | |
| runs-on: ubuntu-latest | |
| needs: [perf-tests] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: false | |
| - name: Download a distribution artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: benchmark-results-* | |
| merge-multiple: true | |
| path: benchmark_results | |
| - name: Use Python 3.13 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| - name: Install dependencies | |
| run: | | |
| cd perf | |
| pip install -r req.txt | |
| - name: Generate report | |
| shell: bash | |
| run: | | |
| ls -R benchmark_results | |
| chmod -R 755 benchmark_results | |
| export PYTHONPATH="." | |
| python perf/genreport.py | |
| - name: Upload reports | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-reports | |
| path: "**/*.xlsx" # Upload all .xlsx files |