Performance analysis #174
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Performance analysis | |
on: | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 */2 * * *" # every 2 hours | |
jobs: | |
perf-analysis: | |
name: Performance analysis | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Get the yarn cache path. | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "{dir}={$(yarn config get cacheFolder)}" >> $GITHUB_OUTPUT | |
- name: Restore yarn cache | |
uses: actions/cache@v3 | |
id: yarn-cache | |
with: | |
path: | | |
${{ steps.yarn-cache-dir-path.outputs.dir }} | |
**/node_modules | |
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }} | |
restore-keys: "yarn-cache-folder-" | |
# Actually install packages with Yarn | |
- name: Install packages | |
run: yarn install | |
env: | |
YARN_CHECKSUM_BEHAVIOR: "update" | |
- name: Install Replay Chromium | |
run: npx replayio@latest install | |
- name: Wait for Vercel preview deployment to be ready | |
uses: patrickedqvist/wait-for-vercel-preview@v1.3.1 | |
if: github.event_name == 'pull_request' | |
id: wait-for-vercel-preview | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
max_timeout: 240 | |
- name: Run performance analysis | |
run: yarn run perf-analysis | |
env: | |
REPLAY_API_KEY: ${{ secrets.PERFORMANCE_ANALYSIS_REPLAY_API_KEY }} | |
DEVTOOLS_URL: ${{ steps.wait-for-vercel-preview.outputs.url }} | |
GITHUB_REPOSITORY: ${{ env.GITHUB_REPOSITORY }} | |
GITHUB_REF_NAME: ${{ env.GITHUB_REF_NAME }} | |
GITHUB_PR: ${{ github.event.pull_request && github.event.pull_request.number }} | |
GITHUB_SHA: ${{ env.GITHUB_SHA }} |