Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance analysis workflow #10625

Merged
Merged
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
50 changes: 50 additions & 0 deletions .github/workflows/perf_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 }}
7 changes: 5 additions & 2 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/e2e-tests/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/e2e-tests/scripts/record-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ function getRecordingId(file: string) {
}
return contents;
}
return null;
return;
} catch (e) {
return null;
return;
}
}

export async function recordNodeExample(scriptPath: string): Promise<string> {
export async function recordNodeExample(scriptPath: string): Promise<string | undefined> {
const nodePath = config.nodePath || execSync("which replay-node").toString().trim();
if (!nodePath) {
console.warn("\x1b[1m\x1b[31m" + "Node e2e tests require @replayio/node" + "\x1b[0m");
Expand Down
102 changes: 0 additions & 102 deletions packages/e2e-tests/scripts/record-playwright.ts

This file was deleted.

Loading
Loading