From 3bfaa849d4a32d30f0bdd235c51e4394343f0659 Mon Sep 17 00:00:00 2001 From: Ostap Brehin Date: Mon, 7 Sep 2026 16:52:08 +0100 Subject: [PATCH] ci: cap benchmark runtime and split its steps --- .github/workflows/benchmark.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 2df8b3f093..ee4bba0405 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -27,6 +27,7 @@ jobs: if: ${{ github.event.pull_request.base.ref == github.event.repository.default_branch }} name: Performance Regression Check runs-on: ubuntu-latest + timeout-minutes: 180 steps: - name: Checkout PR branch @@ -44,23 +45,35 @@ jobs: - name: Install dependencies uses: ramsey/composer-install@v3 - - name: Benchmark base branch + - name: Check out base branch run: | git checkout ${{ github.event.pull_request.base.sha }} cp .env.example .env sed -i 's/^INTERNAL_CACHES=.*/INTERNAL_CACHES=false/' .env sed -i 's/^DISCOVERY_CACHE=.*/DISCOVERY_CACHE=false/' .env - composer update --no-interaction --prefer-dist --quiet - vendor/bin/phpbench run --tag=base --store --progress=none - - name: Benchmark PR branch + - name: Install base branch dependencies + timeout-minutes: 20 + run: composer update --no-interaction --prefer-dist --quiet + + - name: Benchmark base branch + timeout-minutes: 70 + run: vendor/bin/phpbench run --tag=base --store --progress=none + + - name: Check out PR branch run: | git checkout ${{ github.event.pull_request.head.sha }} cp .env.example .env sed -i 's/^INTERNAL_CACHES=.*/INTERNAL_CACHES=false/' .env sed -i 's/^DISCOVERY_CACHE=.*/DISCOVERY_CACHE=false/' .env - composer update --no-interaction --prefer-dist --quiet - vendor/bin/phpbench run --tag=pr --store --ref=base --report=aggregate --progress=none --output=benchmark-comment | tee benchmark-result.txt || true + + - name: Install PR branch dependencies + timeout-minutes: 20 + run: composer update --no-interaction --prefer-dist --quiet + + - name: Benchmark PR branch + timeout-minutes: 70 + run: vendor/bin/phpbench run --tag=pr --store --ref=base --report=aggregate --progress=none --output=benchmark-comment | tee benchmark-result.txt || true - name: Prepare artifact run: |