Skip to content

Commit

Permalink
Fix benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSazonov committed Jul 26, 2024
1 parent 0acde6e commit c83e43a
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 19 deletions.
23 changes: 15 additions & 8 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,20 @@ jobs:
scripts/detect_abi3_violations.sh
scripts/check_wheel_contents.sh
- name: Install pyCFML from created Python package wheel
shell: bash
run: scripts/install_pycfml_from_wheel.sh

- name: Run pyCFML unit tests
shell: bash
run: scripts/run_pycfml_unit_tests.sh

- name: Run pyCFML functional tests
shell: bash
run: |
scripts/run_pycfml_functional_tests_no_benchmarks.sh
scripts/run_pycfml_functional_tests_with_benchmarks.sh
- name: Prepare for uploading Python package wheel of pyCFML
shell: bash
run: echo "WHEEL_DIR=$(python3 pybuild.py --print-wheel-dir)" >> $GITHUB_ENV
Expand Down Expand Up @@ -249,7 +263,7 @@ jobs:
name: pycfml-wheel_${{ matrix.os }}_${{ matrix.toolchain.exe }} # name (without .zip) of the zipped artifact uploaded on the previous jobs
path: ${{ env.WHEEL_DIR }} # directory to extract downloaded zipped artifacts

- name: Install pyCFML from downloaded Python package wheel (with dev extras)
- name: Install pyCFML from downloaded Python package wheel
shell: bash
run: scripts/install_pycfml_from_wheel.sh

Expand All @@ -262,10 +276,3 @@ jobs:
run: |
scripts/run_pycfml_functional_tests_no_benchmarks.sh
scripts/run_pycfml_functional_tests_with_benchmarks.sh
- name: Push benchmark results to repository
uses: EndBug/add-and-commit@v9
with:
add: '.benchmarks/pyCFML'
message: 'Auto push pyCFML benchmark results by GitHub Action for ${{ runner.os }} + ${{ matrix.toolchain.exe }}'
pull: '--rebase --autostash'
19 changes: 17 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,20 @@ jobs:
scripts/create_pycfml_python_wheel.sh
scripts/rename_pycfml_python_wheel.sh
- name: Install pyCFML from created Python package wheel
shell: bash
run: scripts/install_pycfml_from_wheel.sh

- name: Run pyCFML unit tests
shell: bash
run: scripts/run_pycfml_unit_tests.sh

- name: Run pyCFML functional tests
shell: bash
run: |
scripts/run_pycfml_functional_tests_no_benchmarks.sh
scripts/run_pycfml_functional_tests_with_benchmarks.sh
- name: Prepare for uploading Python package wheel of pyCFML
shell: bash
run: |
Expand Down Expand Up @@ -250,7 +264,7 @@ jobs:
name: pycfml-wheel_${{ matrix.os }}_${{ matrix.python-version }} # name (without .zip) of the zipped artifact uploaded on the previous jobs
path: ${{ env.WHEEL_DIR }} # directory to extract downloaded zipped artifacts

- name: Install pyCFML from downloaded Python package wheel (with dev extras)
- name: Install pyCFML from downloaded Python package wheel
shell: bash
run: scripts/install_pycfml_from_wheel.sh

Expand All @@ -264,7 +278,8 @@ jobs:
scripts/run_pycfml_functional_tests_no_benchmarks.sh
scripts/run_pycfml_functional_tests_with_benchmarks.sh
- name: Push benchmark results to repository
- name: Push benchmark results to repository (Python 3.11 only)
if: matrix.python-version == '3.11'
uses: EndBug/add-and-commit@v9
with:
add: '.benchmarks/pyCFML'
Expand Down
12 changes: 6 additions & 6 deletions pybuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,10 +838,10 @@ def run_cfml_functional_tests_with_benchmarks():
msg = _echo_msg(f"Running functional tests with benchmarks from '{relpath}'")
lines.append(msg)
cmd = CONFIG['template']['run-benchmarks']['base']
if _github_branch() == 'master':
cmd += ' ' + CONFIG['template']['run-benchmarks']['master-branch']
if _github_branch() == 'develop':
cmd += ' ' + CONFIG['template']['run-benchmarks']['develop-branch']
else:
cmd += ' ' + CONFIG['template']['run-benchmarks']['non-master-branch']
cmd += ' ' + CONFIG['template']['run-benchmarks']['non-develop-branch']
cmd = cmd.replace('{PATH}', abspath)
cmd = cmd.replace('{PROJECT}', project_name)
if _github_actions():
Expand Down Expand Up @@ -1393,10 +1393,10 @@ def run_pycfml_functional_tests_with_benchmarks():
msg = _echo_msg(f"Running functional tests with benchmarks from '{relpath}'")
lines.append(msg)
cmd = CONFIG['template']['run-benchmarks']['base']
if _github_branch() == 'master':
cmd += ' ' + CONFIG['template']['run-benchmarks']['master-branch']
if _github_branch() == 'develop':
cmd += ' ' + CONFIG['template']['run-benchmarks']['develop-branch']
else:
cmd += ' ' + CONFIG['template']['run-benchmarks']['non-master-branch']
cmd += ' ' + CONFIG['template']['run-benchmarks']['non-develop-branch']
cmd = cmd.replace('{PATH}', abspath)
cmd = cmd.replace('{PROJECT}', project_name)
if _github_actions():
Expand Down
6 changes: 3 additions & 3 deletions pybuild.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ install-wheel = 'python3 -m pip install {PACKAGE} --force-reinstall --find-links
run-python = 'python3 {PATH} {OPTIONS}'
run-tests = 'pytest {PATH} --color=yes --benchmark-disable'
run-benchmarks.base = 'pytest {PATH} --color=yes --benchmark-only --benchmark-storage="file://./.benchmarks/{PROJECT}/{RUNNER}/{COMPILER}/{PROCESSOR}" --benchmark-warmup=on --benchmark-columns="median, iqr, ops"'
run-benchmarks.master-branch = '--benchmark-autosave'
run-benchmarks.non-master-branch = '--benchmark-autosave'
#run-benchmarks.non-master-branch = '--benchmark-compare --benchmark-compare-fail=median:25%'
run-benchmarks.develop-branch = '--benchmark-autosave'
run-benchmarks.non-develop-branch = '--benchmark-autosave'
#run-benchmarks.non-develop-branch = '--benchmark-compare --benchmark-compare-fail=median:25%'

######################
# Build configurations
Expand Down

0 comments on commit c83e43a

Please sign in to comment.