Skip to content

feat(styles): replace Quicksand with Nunito and leverage wider weight… #538

feat(styles): replace Quicksand with Nunito and leverage wider weight…

feat(styles): replace Quicksand with Nunito and leverage wider weight… #538

Workflow file for this run

name: E2E Tests
permissions:
contents: read
pages: write
id-token: write
pull-requests: write
on:
workflow_dispatch:
push:
branches: [main, next]
jobs:
e2e:
runs-on: ubuntu-24.04-arm
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
outputs:
test-result: ${{ steps.test.outcome }}
steps:
- name: Setup
id: setup
uses: complexdatacollective/github-actions/setup-pnpm@v1
with:
install: 'false'
cache-path: .pnpm-docker-store
cache-key-prefix: pnpm-docker-store
- name: Run E2E tests (${{ matrix.browser }})
id: test
run: pnpm test:e2e
env:
CI: true
E2E_BROWSERS: ${{ matrix.browser }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.browser }}
path: |
tests/e2e/playwright-report/
tests/e2e/test-results/
retention-days: 30
- name: Upload test videos
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-videos-${{ matrix.browser }}
path: tests/e2e/test-results/**/*.webm
retention-days: 7
- name: Save pnpm cache
if: always() && steps.setup.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: .pnpm-docker-store
key: ${{ steps.setup.outputs.cache-key }}
resolve-pr:
if: failure()
needs: e2e
runs-on: ubuntu-latest
outputs:
pr-number: ${{ steps.pr.outputs.number }}
head-sha: ${{ steps.pr.outputs.head_sha }}
branch: ${{ steps.pr.outputs.branch }}
steps:
- name: Resolve PR context
id: pr
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "number=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
echo "head_sha=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT"
echo "branch=${{ github.head_ref }}" >> "$GITHUB_OUTPUT"
else
PR_NUMBER=$(gh pr list --repo "${{ github.repository }}" --head "${{ github.ref_name }}" --json number --jq '.[0].number')
if [ -n "$PR_NUMBER" ] && [ "$PR_NUMBER" != "null" ]; then
echo "number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
fi
echo "head_sha=${{ github.sha }}" >> "$GITHUB_OUTPUT"
echo "branch=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi
# Deploy report to GitHub Pages on test failure (PR-specific subdirectory)
deploy-report:
if: failure() && needs.resolve-pr.outputs.pr-number != ''
needs: [e2e, resolve-pr]
runs-on: ubuntu-latest
# Single concurrency group for all Pages deployments to prevent race conditions
concurrency:
group: e2e-pages-deploy
cancel-in-progress: false
environment:
name: github-pages
url: https://complexdatacollective.github.io/Fresco/pr-${{ needs.resolve-pr.outputs.pr-number }}/
steps:
- name: Download playwright report
uses: actions/download-artifact@v4
with:
pattern: playwright-report-*
path: new-report
merge-multiple: true
- name: Fetch existing GitHub Pages content
uses: actions/checkout@v4
with:
ref: gh-pages
path: existing-pages
continue-on-error: true
- name: Merge reports into PR subdirectory
run: |
mkdir -p merged
# Copy existing pages content if it exists
if [ -d existing-pages ] && [ "$(ls -A existing-pages 2>/dev/null)" ]; then
cp -r existing-pages/* merged/ 2>/dev/null || true
# Remove git files
rm -rf merged/.git
fi
# Create PR-specific subdirectory with new report
mkdir -p merged/pr-${{ needs.resolve-pr.outputs.pr-number }}
cp -r new-report/playwright-report/* merged/pr-${{ needs.resolve-pr.outputs.pr-number }}/
# Generate index page listing all reports
cat > merged/index.html << 'EOF'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fresco E2E Test Reports</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; max-width: 800px; margin: 40px auto; padding: 20px; }
h1 { color: #333; }
ul { list-style: none; padding: 0; }
li { padding: 10px 0; border-bottom: 1px solid #eee; }
a { color: #0066cc; text-decoration: none; }
a:hover { text-decoration: underline; }
.timestamp { color: #666; font-size: 0.9em; }
</style>
</head>
<body>
<h1>🎭 Fresco E2E Test Reports</h1>
<p>Failed test reports by PR:</p>
<ul id="reports"></ul>
<script>
const reportsEl = document.getElementById('reports');
const prDirs = Array.from(document.querySelectorAll('a[href^="pr-"]')).map(a => a.getAttribute('href'));
// This will be populated by the directory listing
</script>
</body>
</html>
EOF
# Create a simple directory listing
echo "<ul>" > merged/index.html.tmp
for dir in merged/pr-*/; do
if [ -d "$dir" ]; then
pr_num=$(basename "$dir")
echo " <li><a href=\"$pr_num/\">$pr_num</a></li>" >> merged/index.html.tmp
fi
done
echo "</ul>" >> merged/index.html.tmp
# Build final index
cat > merged/index.html << EOF
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fresco E2E Test Reports</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; max-width: 800px; margin: 40px auto; padding: 20px; }
h1 { color: #333; }
ul { list-style: none; padding: 0; }
li { padding: 10px 0; border-bottom: 1px solid #eee; }
a { color: #0066cc; text-decoration: none; font-size: 1.1em; }
a:hover { text-decoration: underline; }
</style>
</head>
<body>
<h1>🎭 Fresco E2E Test Reports</h1>
<p>Failed test reports by PR:</p>
$(cat merged/index.html.tmp)
</body>
</html>
EOF
rm merged/index.html.tmp
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: merged/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Comment on PR with report link
uses: peter-evans/create-or-update-comment@v5
with:
issue-number: ${{ needs.resolve-pr.outputs.pr-number }}
body: |
## 🎭 Playwright E2E Test Report
❌ **Tests failed.** View the full report here:
👉 **[https://complexdatacollective.github.io/Fresco/pr-${{ needs.resolve-pr.outputs.pr-number }}/](https://complexdatacollective.github.io/Fresco/pr-${{ needs.resolve-pr.outputs.pr-number }}/)**
<details>
<summary>Report details</summary>
- **Workflow run:** [View logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
- **Commit:** ${{ needs.resolve-pr.outputs.head-sha }}
- **Branch:** `${{ needs.resolve-pr.outputs.branch }}`
</details>