From 18070013bb2f3bea96139a087ba3e15a930a460d Mon Sep 17 00:00:00 2001 From: Drew Leonard Date: Wed, 8 May 2024 11:41:35 +0100 Subject: [PATCH] Move benchmark workflow out of main tox action into codspeed Let's see how this goes --- .github/workflows/codspeed.yml | 19 +++++++++++++++++++ .github/workflows/main.yml | 1 - tox.ini | 14 -------------- 3 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/codspeed.yml diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml new file mode 100644 index 00000000..b04db588 --- /dev/null +++ b/.github/workflows/codspeed.yml @@ -0,0 +1,19 @@ +name: codspeed-benchmarks + +on: + push: + branches: + - "main" + pull_request: + workflow_dispatch: + +jobs: + benchmarks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run benchmarks + uses: CodspeedHQ/action@v2 + with: + token: ${{ secrets.CODSPEED_TOKEN }} + run: "pytest -vvv -r fEs --pyargs dkist -k test_benchmarks --benchmark-autosave" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0d529436..4963abc2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,7 +42,6 @@ jobs: - windows: py311-online - macos: py310 - linux: py310-oldestdeps - - linux: benchmarks secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/tox.ini b/tox.ini index 3078d795..920b4cd7 100644 --- a/tox.ini +++ b/tox.ini @@ -90,17 +90,3 @@ commands = !notebooks: sphinx-build -j 1 --color -W --keep-going -b html -d _build/.doctrees . _build/html -D nb_execution_mode=off {posargs} notebooks: sphinx-build -j 1 --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs} python -c 'import pathlib; print("Documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "docs" / "_build" / "index.html"))' - -[testenv:benchmarks] -description = Run benchmarks on PR and compare against main to ensure there are no performance regressions -allowlist_externals=git -commands = - git clone https://github.com/DKISTDC/dkist-benchmarks.git {env_tmp_dir}/dkist-benchmarks - {env:PYTEST_COMMAND} -k test_benchmarks --benchmark-autosave --benchmark-compare={env_tmp_dir}/dkist-benchmarks/main.json --benchmark-compare-fail=mean:5% - -[testenv:benchmark-main] -description = Run benchmarks on main to keep comparison data up to date -allowlist_externals = git,cp -commands = - {env:PYTEST_COMMAND} -k test_benchmarks --benchmark-save=main - cp {toxinidir}/.tmp/benchmark-main/.benchmarks/Linux-CPython-3.10-64bit/0001_main.json /github/main.json