Skip to content

fix(deps): update tanstack-router monorepo #1564

fix(deps): update tanstack-router monorepo

fix(deps): update tanstack-router monorepo #1564

Workflow file for this run

name: Playwright Tests
on:
pull_request:
branches: [develop]
permissions:
contents: read
pull-requests: write
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
environment: Preview
env:
REPORT_DIR: yps-crispy-carnival
CONVEX_PREVIEW_NAME: pr-${{ github.event.pull_request.number }}-e2e
steps:
- uses: actions/checkout@v6
- name: Setup
uses: ./.github/actions/setup
- name: Setup Playwright
uses: ./.github/actions/playwright
- name: Deploy Preview
id: preview
run: |
npx convex deploy --preview-create "$CONVEX_PREVIEW_NAME" \
--cmd 'echo "PREVIEW_URL=$CONVEX_URL" >> "$GITHUB_OUTPUT"' \
--cmd-url-env-var-name CONVEX_URL
env:
CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY }}
- name: Seed Database
run: |
npx convex import --replace-all convex-seeds/seeds/db.zip --yes \
--preview-name "${{ env.CONVEX_PREVIEW_NAME }}"
env:
CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY }}
- name: Run Playwright tests
id: playwright
run: pnpm e2e
env:
VITE_CONVEX_URL: ${{ steps.preview.outputs.PREVIEW_URL }}
CONVEX_PREVIEW_NAME: ${{ env.CONVEX_PREVIEW_NAME }}
E2E_CLERK_USER: ${{ vars.E2E_CLERK_USER }}
E2E_CLERK_PASSWORD: ${{ vars.E2E_CLERK_PASSWORD }}
CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }}
VITE_CLERK_PUBLISHABLE_KEY: ${{ secrets.VITE_CLERK_PUBLISHABLE_KEY }}
CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY }}
- uses: actions/upload-artifact@v6
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Deploy Report to GitHub Pages
if: ${{ !cancelled() }}
run: |
git clone https://x-access-token:${{ secrets.HOSTING_PAGES_TOKEN }}@github.com/yn1323/hosting-pages.git
rm -rf hosting-pages/$REPORT_DIR/${{ github.event.pull_request.number }}
mkdir -p hosting-pages/$REPORT_DIR/${{ github.event.pull_request.number }}
cp -r playwright-report/* hosting-pages/$REPORT_DIR/${{ github.event.pull_request.number }}/
cd hosting-pages
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Playwright report for PR #${{ github.event.pull_request.number }}" || exit 0
git push
- name: Comment PR with Report Link
if: ${{ !cancelled() }}
uses: actions/github-script@v8
with:
script: |
const fs = require('fs');
const reportUrl = `https://yn1323.github.io/hosting-pages/${{ env.REPORT_DIR }}/${{ github.event.pull_request.number }}/`;
const testResult = '${{ steps.playwright.outcome }}';
const statusEmoji = testResult === 'success' ? '✅' : '❌';
const statusText = testResult === 'success' ? '成功' : '失敗';
let summary = '';
try {
const json = JSON.parse(fs.readFileSync('test-results.json', 'utf8'));
const suites = json.suites || [];
let passed = 0, failed = 0, skipped = 0;
const rows = [];
function collectTests(suites) {
for (const suite of suites) {
for (const spec of (suite.specs || [])) {
for (const test of (spec.tests || [])) {
const status = test.status;
if (status === 'expected') passed++;
else if (status === 'unexpected') failed++;
else if (status === 'skipped') skipped++;
const icon = status === 'expected' ? '✅' : status === 'unexpected' ? '❌' : '⏭';
rows.push(`| ${icon} | ${spec.title} |`);
}
}
if (suite.suites) collectTests(suite.suites);
}
}
collectTests(suites);
summary = `\n\n**${passed} passed** / **${failed} failed** / **${skipped} skipped**\n\n`;
if (rows.length > 0) {
summary += `| Status | Test |\n|--------|------|\n${rows.join('\n')}`;
}
} catch (e) {
summary = '\n\n⚠️ テスト結果JSONの読み込みに失敗しました';
}
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `## 📊 Playwright Test Report\n\n${statusEmoji} **テスト結果: ${statusText}**${summary}\n\n[View Report](${reportUrl})\n\nデプロイ先: https://github.com/yn1323/hosting-pages`
});