From 00d438c74b26aae0b115c6f9587b3c4b59676eb9 Mon Sep 17 00:00:00 2001 From: Rico Kahler Date: Sun, 29 Sep 2024 10:04:08 -0500 Subject: [PATCH] add manual workflow dispatch --- .github/workflows/efps.yml | 14 ++++++++++++++ perf/efps/index.ts | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/efps.yml b/.github/workflows/efps.yml index dbe3c389a63..d46e9c6d557 100644 --- a/.github/workflows/efps.yml +++ b/.github/workflows/efps.yml @@ -1,6 +1,18 @@ name: eFPS Test on: pull_request: + workflow_dispatch: + inputs: + reference_tag: + description: "Reference tag for comparison" + required: true + default: "latest" + enable_profiler: + description: "Enable profiler" + required: true + type: boolean + default: false + jobs: install: timeout-minutes: 30 @@ -64,6 +76,8 @@ jobs: VITE_PERF_EFPS_PROJECT_ID: ${{ secrets.PERF_EFPS_PROJECT_ID }} VITE_PERF_EFPS_DATASET: ${{ secrets.PERF_EFPS_DATASET }} PERF_EFPS_SANITY_TOKEN: ${{ secrets.PERF_EFPS_SANITY_TOKEN }} + REFERENCE_TAG: ${{ github.event.inputs.reference_tag || 'latest' }} + ENABLE_PROFILER: ${{ github.event.inputs.enable_profiler || false }} run: pnpm efps:test - name: PR comment with report diff --git a/perf/efps/index.ts b/perf/efps/index.ts index 85efd2ccf99..6e7e864e962 100644 --- a/perf/efps/index.ts +++ b/perf/efps/index.ts @@ -24,8 +24,10 @@ const WARNING_THRESHOLD = 0.2 const TEST_ATTEMPTS = process.env.CI ? 3 : 1 const HEADLESS = true -const ENABLE_PROFILER = false -const REFERENCE_TAG = 'latest' +// eslint-disable-next-line turbo/no-undeclared-env-vars +const ENABLE_PROFILER = process.env.ENABLE_PROFILER === 'true' +// eslint-disable-next-line turbo/no-undeclared-env-vars +const REFERENCE_TAG = process.env.REFERENCE_TAG || 'latest' const TESTS = [article, recipe, synthetic] const projectId = process.env.VITE_PERF_EFPS_PROJECT_ID!