Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/actions/percy-exec/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
env:
PERCY_TOKEN: ${{ inputs.percy-token }}
PERCY_BROWSER_EXECUTABLE: ${{ inputs.browser-executable }}
PERCY_COMMAND: ${{ inputs.command }}
run: |
# Percy otherwise downloads its own Chromium from storage.googleapis.com
# on the first snapshot. That download stalls in CI, which blocks the
Expand All @@ -39,12 +40,14 @@
export PERCY_BROWSER_EXECUTABLE
fi
echo "PERCY_BROWSER_EXECUTABLE=${PERCY_BROWSER_EXECUTABLE:-<unset: Percy will download Chromium>}"
npx percy exec -- ${{ inputs.command }}
npx percy exec -- bash -c "$PERCY_COMMAND"

Check warning on line 43 in .github/actions/percy-exec/action.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

"npx" can install packages on-demand and run their lifecycle scripts.

See more on https://sonarcloud.io/project/issues?id=plotly_dash&issues=AaJFirzgY3rQBr1kYwVU&open=AaJFirzgY3rQBr1kYwVU&pullRequest=4243

Check warning on line 43 in .github/actions/percy-exec/action.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define exact package version to avoid installing unverified releases.

See more on https://sonarcloud.io/project/issues?id=plotly_dash&issues=AaJFirzgY3rQBr1kYwVV&open=AaJFirzgY3rQBr1kYwVV&pullRequest=4243

- name: Run without Percy (fork PR)
if: inputs.percy-token == ''
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
PERCY_COMMAND: ${{ inputs.command }}
run: |
echo "::notice::Skipping Percy (no token available - likely a fork PR)"
${{ inputs.command }}
bash -c "$PERCY_COMMAND"
6 changes: 4 additions & 2 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,14 @@ jobs:
- name: Open baseline update PR
env:
GH_TOKEN: ${{ github.token }}
RUN_ID: ${{ github.run_id }}
REF_NAME: ${{ github.ref_name }}
run: |
if git diff --quiet -- benchmarks/baseline.json; then
echo "Baseline unchanged; nothing to commit."
exit 0
fi
branch="benchmarks/regenerate-baseline-${{ github.run_id }}"
branch="benchmarks/regenerate-baseline-${RUN_ID}"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git switch -c "$branch"
Expand All @@ -227,7 +229,7 @@ jobs:
echo "</details>"
} > "$RUNNER_TEMP/pr-body.md"
gh pr create \
--base "${{ github.ref_name }}" \
--base "$REF_NAME" \
--head "$branch" \
--title "Regenerate benchmark baseline on CI hardware" \
--body-file "$RUNNER_TEMP/pr-body.md"