Skip to content

perf(mobile): memoize getDottedAreaPath and build via array join #3381

perf(mobile): memoize getDottedAreaPath and build via array join

perf(mobile): memoize getDottedAreaPath and build via array join #3381

Workflow file for this run

name: Visreg Web
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches: [master]
concurrency:
group: Visreg-Web-${{github.ref_name}}-${{github.event.pull_request.number || github.sha}}
cancel-in-progress: ${{github.event_name == 'pull_request'}}
permissions:
contents: read
actions: read
env:
CI: true
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
jobs:
visreg-web:
name: Visreg Web
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 100 # TODO: This needs to include the merge-base
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} # Ensure correct ref for push/PR
- uses: ./.github/actions/setup
- name: Set branch name for Percy
id: set_branch
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "PERCY_BRANCH=${{ github.head_ref }}" >> "$GITHUB_ENV"
else
echo "PERCY_BRANCH=${{ github.ref_name }}" >> "$GITHUB_ENV"
fi
- name: Evaluate Visreg Web Should Run
id: visreg-should-run
# Do not run affected tests when the run-all `visreg` label is present
if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'visreg') }}
run: |
if yarn workspace @coinbase/cds-storybook should-run-visreg; then
echo "Storybook changes detected, running Visreg Web Percy run"
echo "SHOULD_RUN_VISREG=true" >> "$GITHUB_OUTPUT"
else
echo "No storybook changes detected, skipping Visreg Web Percy run"
echo "SHOULD_RUN_VISREG=false" >> "$GITHUB_OUTPUT"
fi
shell: bash
- name: Setup Chrome
uses: browser-actions/setup-chrome@b94431e051d1c52dcbe9a7092a4f10f827795416 # v2.1.0
with:
chrome-version: stable
install-chromedriver: true
- name: Visreg Web
# Run on `master` or when `visreg` label is present, or when an project that affects storybook is changed
if: ${{ github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'visreg') || steps.visreg-should-run.outputs.SHOULD_RUN_VISREG == 'true' }}
run: yarn nx run storybook:percy
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
STORYBOOK_SKIP_ANIMATION: true
PERCY_BRANCH: ${{ env.PERCY_BRANCH }}
CI: true