Add eq_fixed option to BoundaryError
#3298
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
| name: Memory Benchmarks | |
| on: | |
| pull_request_target: | |
| branches: | |
| - master | |
| types: [opened, synchronize] | |
| workflow_dispatch: | |
| jobs: | |
| memory-benchmark: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write # allows posting the benchmark comment on the PR | |
| contents: read # allows checkout; prevents the token from pushing code or modifying workflows if exfiltrated by fork code | |
| actions: read # allows `gh cache list`; all other scopes default to none | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| strategy: | |
| matrix: | |
| python-version: ["3.12"] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| allow-unsafe-pr-checkout: true | |
| - name: Filter changes | |
| id: changes | |
| uses: dorny/paths-filter@v4 | |
| with: | |
| filters: | | |
| has_changes: | |
| - 'desc/**' | |
| - 'tests/**' | |
| - 'requirements.txt' | |
| - 'devtools/dev-requirements.txt' | |
| - 'setup.cfg' | |
| - '.github/workflows/memory_benchmark.yml' | |
| - name: Check for relevant changes | |
| id: check_changes | |
| run: echo "has_changes=${{ !contains(github.event.pull_request.labels.*.name, 'only-docs-comments') && steps.changes.outputs.has_changes}}" >> $GITHUB_ENV | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Check full Python version | |
| run: | | |
| python --version | |
| python_version=$(python --version 2>&1 | cut -d' ' -f2) | |
| echo "Python version: $python_version" | |
| echo "version=$python_version" >> $GITHUB_ENV | |
| - name: Restore Python environment cache | |
| if: env.has_changes == 'true' | |
| id: restore-env | |
| uses: actions/cache/restore@v6 | |
| with: | |
| path: .venv-${{ env.version }} | |
| key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} | |
| - name: Set up virtual environment if not restored from cache | |
| if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true' | |
| run: | | |
| gh cache list | |
| python -m venv .venv-${{ env.version }} | |
| source .venv-${{ env.version }}/bin/activate | |
| python -m pip install --upgrade pip | |
| pip install -r devtools/dev-requirements.txt | |
| pip install matplotlib==3.10.8 | |
| # Add more memory just in case | |
| - name: Set Swap Space | |
| if: env.has_changes == 'true' | |
| uses: pierotofy/set-swap-space@master | |
| with: | |
| swap-size-gb: 4 | |
| - name: Action Details | |
| if: env.has_changes == 'true' | |
| run: | | |
| source .venv-${{ env.version }}/bin/activate | |
| which python | |
| python --version | |
| pwd | |
| lscpu | |
| pip list | |
| - name: Benchmark with pytest-benchmark (PR) | |
| if: env.has_changes == 'true' | |
| run: | | |
| source .venv-${{ env.version }}/bin/activate | |
| cd tests/benchmarks | |
| python memory_benchmark_cpu.py pr | |
| - name: Checkout current master | |
| if: env.has_changes == 'true' | |
| uses: actions/checkout@v7 | |
| with: | |
| ref: master | |
| clean: false | |
| - name: Checkout benchmarks from PR head | |
| if: env.has_changes == 'true' | |
| run: git checkout ${{ github.event.pull_request.head.sha }} -- tests/benchmarks | |
| - name: Remove PR virtual environment before master setup | |
| if: env.has_changes == 'true' | |
| run: rm -rf .venv-${{ env.version }} | |
| - name: Restore Python environment cache | |
| if: env.has_changes == 'true' | |
| id: restore-env2 | |
| uses: actions/cache/restore@v5 | |
| with: | |
| path: .venv-${{ env.version }} | |
| key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }} | |
| - name: Set up virtual environment if not restored from cache | |
| if: steps.restore-env2.outputs.cache-hit != 'true' && env.has_changes == 'true' | |
| run: | | |
| gh cache list | |
| python -m venv .venv-${{ env.version }} | |
| source .venv-${{ env.version }}/bin/activate | |
| python -m pip install --upgrade pip | |
| pip install -r devtools/dev-requirements.txt | |
| pip install matplotlib==3.10.8 | |
| - name: Action Details | |
| if: env.has_changes == 'true' | |
| run: | | |
| source .venv-${{ env.version }}/bin/activate | |
| which python | |
| python --version | |
| pwd | |
| lscpu | |
| pip list | |
| - name: Benchmark with pytest-benchmark (MASTER) | |
| if: env.has_changes == 'true' | |
| run: | | |
| source .venv-${{ env.version }}/bin/activate | |
| cd tests/benchmarks | |
| python memory_benchmark_cpu.py master | |
| - name: Compare latest commit results to the master branch results | |
| if: env.has_changes == 'true' | |
| run: | | |
| source .venv-${{ env.version }}/bin/activate | |
| cd tests/benchmarks | |
| pwd | |
| python compare_mem_results.py | |
| cat commit_msg.txt | |
| - name: Upload memory comparison plot | |
| if: env.has_changes == 'true' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: compare-plot | |
| path: tests/benchmarks/compare.png | |
| - name: Comment PR with the results | |
| if: env.has_changes == 'true' | |
| uses: thollander/actions-comment-pull-request@v3 | |
| env: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| file-path: tests/benchmarks/commit_msg.txt | |
| comment-tag: memory-benchmark |