From c70bf6a8c0a7993219280e4d6609724817b5a4dd Mon Sep 17 00:00:00 2001 From: Johannes Mueller Date: Fri, 12 Jul 2024 14:20:28 +0200 Subject: [PATCH] Add benchmark test action Signed-off-by: Johannes Mueller --- .../workflows/wheelbuild-benchmark-test.yml | 62 +++++++++++++++++++ tools/odbclient/pyproject.toml | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/wheelbuild-benchmark-test.yml diff --git a/.github/workflows/wheelbuild-benchmark-test.yml b/.github/workflows/wheelbuild-benchmark-test.yml new file mode 100644 index 00000000..431284a4 --- /dev/null +++ b/.github/workflows/wheelbuild-benchmark-test.yml @@ -0,0 +1,62 @@ +name: Build wheels and perform benchmarks + +on: + pull_request: + branches: [develop, master] + +env: + CIBW_BUILD: cp37-* cp38-* cp39-* cp310-* cp311-* cp312-* + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + CIBW_MANYLINUX_I686_IMAGE: manylinux2014 + +jobs: + build_wheels: + name: Build wheels on for various systems + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] #, windows-latest] + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: actions/setup-python@v4 + name: Install Python + with: + python-version: '3.12' + + - name: Build wheels + run: | + pip wheel --no-deps -w dist . + - uses: actions/upload-artifact@v4 + with: + name: wheel + path: dist/ + + benchmark: + name: Benchmark tests + needs: [build_wheels] + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/download-artifact@v4 + with: + name: wheel + path: dist/ + - uses: actions/setup-python@v4 + name: Install Python + with: + python-version: '3.12' + - name: Install wheel + run: pip install $(ls -1 dist/*.whl) + - name: Install pytest + run: pip install pytest pytest-cov + - name: Generate test signal + run: python benchmarks/generate_time_signal.py + - name: Run benchmarks + run: pytest --no-cov -rP benchmarks diff --git a/tools/odbclient/pyproject.toml b/tools/odbclient/pyproject.toml index 98ce6044..9f53a7de 100644 --- a/tools/odbclient/pyproject.toml +++ b/tools/odbclient/pyproject.toml @@ -1,6 +1,6 @@ [build-system] # AVOID CHANGING REQUIRES: IT WILL BE UPDATED BY PYSCAFFOLD! -requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5", "wheel"] +requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5", "wheel", "cython"] build-backend = "setuptools.build_meta" [tool.setuptools_scm]