From 80ce3bd461121f5a4fab867e8cbb83ddea4e37dd Mon Sep 17 00:00:00 2001 From: marcosschroh Date: Thu, 30 Jan 2025 14:36:41 +0100 Subject: [PATCH] ci: benchmarck compare is now a proper jobs separated from the test job --- .github/workflows/bench-compare.yaml | 38 ++++++++++++++++++++++++++++ .github/workflows/pr-tests.yaml | 33 ------------------------ scripts/bench-compare | 3 +++ 3 files changed, 41 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/bench-compare.yaml diff --git a/.github/workflows/bench-compare.yaml b/.github/workflows/bench-compare.yaml new file mode 100644 index 0000000..ee36208 --- /dev/null +++ b/.github/workflows/bench-compare.yaml @@ -0,0 +1,38 @@ +name: Benchmark Compare + +on: + pull_request: + branches: ["*"] + +jobs: + bench: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + architecture: x64 + - name: Set Cache + uses: actions/cache@v4 + id: cache # name for referring later + with: + path: .venv/ + # The cache key depends on poetry.lock + key: ${{ runner.os }}-cache-${{ hashFiles('poetry.lock') }}-313 + restore-keys: | + ${{ runner.os }}-cache- + ${{ runner.os }}- + - name: Install Dependencies + # if: steps.cache.outputs.cache-hit != 'true' + run: | + python -m pip install -U pip poetry + poetry env use python3.13 + poetry config --local virtualenvs.in-project true + poetry install + - name: Benchmark regression test + run: | + ./scripts/bench-compare \ No newline at end of file diff --git a/.github/workflows/pr-tests.yaml b/.github/workflows/pr-tests.yaml index 5ae7148..3397710 100644 --- a/.github/workflows/pr-tests.yaml +++ b/.github/workflows/pr-tests.yaml @@ -60,36 +60,3 @@ jobs: name: kstreams fail_ci_if_error: true token: ${{secrets.CODECOV_TOKEN}} - bench: - # do not run on bench commits, which have automatically been generated by the bench_release job - if: ${{ !startsWith(github.event.head_commit.message, 'bench:') }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup python - uses: actions/setup-python@v5 - with: - python-version: '3.13' - architecture: x64 - - name: Set Cache - uses: actions/cache@v4 - id: cache # name for referring later - with: - path: .venv/ - # The cache key depends on poetry.lock - key: ${{ runner.os }}-cache-${{ hashFiles('poetry.lock') }}-313 - restore-keys: | - ${{ runner.os }}-cache- - ${{ runner.os }}- - - name: Install Dependencies - # if: steps.cache.outputs.cache-hit != 'true' - run: | - python -m pip install -U pip poetry - poetry --version - poetry config --local virtualenvs.in-project true - poetry install - - name: Benchmark regression test - run: | - ./scripts/bench-compare \ No newline at end of file diff --git a/scripts/bench-compare b/scripts/bench-compare index 0c93be7..675b1bb 100755 --- a/scripts/bench-compare +++ b/scripts/bench-compare @@ -15,5 +15,8 @@ if [ -d '.venv' ] ; then export PREFIX=".venv/bin/" fi + +python --version +ls -la # Commented out until after merge, so there will be date to compare with. ${PREFIX}pytest tests/test_benchmarks.py --benchmark-compare --benchmark-compare-fail=mean:10%