-
Notifications
You must be signed in to change notification settings - Fork 138
50 lines (48 loc) · 1.74 KB
/
perf_analysis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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 }}