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

test: Add Lighthouse performance tests using Playwright #18

Merged
merged 21 commits into from
Feb 6, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: Fix lighthouse workflow
choiseona committed Jan 21, 2025

Verified

This commit was created on GitHub.com and signed with GitHubโ€™s verified signature. The key has expired.
commit f8b5b320ca06e2bfdda5f06ddc04b8e59eb4fe04
24 changes: 8 additions & 16 deletions .github/workflows/lighthouse-ci-cd.yml
Original file line number Diff line number Diff line change
@@ -60,34 +60,26 @@ jobs:
- name: Build and Start production server
working-directory: ./client
run: |
echo "Building client..."
pnpm build || { echo "Build failed."; exit 1; }
echo "Starting server..."
pnpm build
pnpm start &
npx wait-on http://localhost:4173 || { echo "Server did not start."; exit 1; }
echo "Server started."
npx wait-on http://localhost:4173

- name: Install Playwright browsers
run: npx playwright install

- name: Run Lighthouse audit
working-directory: ./client
id: lighthouse
run: |
OUTPUT=$(pnpm lighthouse)
echo "Lighthouse output: $OUTPUT"
if [ $? -eq 0 ]; then
echo "results<<EOF" >> $GITHUB_OUTPUT
echo "$OUTPUT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "Lighthouse audit completed successfully."
else
echo "Lighthouse audit failed." >&2
exit 1
fi
echo "results<<EOF" >> $GITHUB_OUTPUT
echo "$OUTPUT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Stop server
working-directory: ./client
run: |
pkill -f "pnpm start"
npx wait-on http://localhost:4173 || { echo "Server did not stop."; exit 1; }
echo "Server stopped."

- name: Comment PR