From 1e6f2a0795024e593fdca5389d09efa5823dc5de Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Tue, 1 Jul 2025 15:38:22 +0200 Subject: [PATCH] chore: run instrumented on staging --- .github/workflows/codspeed.yml | 34 ++++++++++++++++++++++++++-- .github/workflows/codspeed2.yml | 40 --------------------------------- 2 files changed, 32 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/codspeed2.yml diff --git a/.github/workflows/codspeed.yml b/.github/workflows/codspeed.yml index 01161a8b27..9eaf746c72 100644 --- a/.github/workflows/codspeed.yml +++ b/.github/workflows/codspeed.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: jobs: - benchmarks: + walltime-benchmarks: name: Run benchmarks runs-on: codspeed-macro-staging env: @@ -41,5 +41,35 @@ jobs: working-directory: backend run: uv run pytest --codspeed -k test_create_item token: ${{ secrets.CODSPEED_TOKEN }} - runner-version: 3.6.0 + upload-url: https://api.staging.preview.codspeed.io/upload + + instrumented-benchmarks: + name: Run benchmarks + runs-on: ubuntu-latest + env: + CODSPEED_LOG: debug + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version-file: "backend/pyproject.toml" + + - name: Install dependencies + run: uv sync --all-extras --dev + working-directory: backend + + - name: Run benchmarks + uses: CodSpeedHQ/action@v3 + env: + CODSPEED_LOG: debug + CODSPEED_USE_PERF: true + with: + working-directory: backend + run: uv run pytest --codspeed -k test_create_item + token: ${{ secrets.CODSPEED_TOKEN }} upload-url: https://api.staging.preview.codspeed.io/upload diff --git a/.github/workflows/codspeed2.yml b/.github/workflows/codspeed2.yml deleted file mode 100644 index d1a73156fa..0000000000 --- a/.github/workflows/codspeed2.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: CodSpeed - -on: - push: - branches: - - master - pull_request: - types: - - opened - - synchronize - -jobs: - test-backend: - runs-on: ubuntu-latest - env: - CODSPEED_LOG: debug - CODSPEED_USE_PERF: 1 - CODSPEED_RUNNER_MODE: "walltime" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12.8" - - name: Install uv - uses: astral-sh/setup-uv@v6 - with: - enable-cache: true - - run: docker compose up -d db - - name: Migrate DB - run: uv run bash scripts/prestart.sh - working-directory: backend - - name: Run tests - uses: CodSpeedHQ/action@main - with: - working-directory: backend - run: uv run pytest -k test_create_item - token: ${{ secrets.CODSPED_TOKEN }} - runner-version: 3.6.0