Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

ci: update playwright.yml (#3413)

白熱62b8c9ca9124
diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml
index 61f2e30783..33c01329a7 100644
--- a/.github/workflows/playwright.yml
+++ b/.github/workflows/playwright.yml
@@ -1,105 +1,19 @@
name: 🎭 Playwright Tests
on:
- workflow_run:
- workflows:
- - 🎬 Setup
- types:
- - completed
+ pull_request:
+ branches: [dev]
jobs:
- setup:
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
- runs-on: ubuntu-latest
-
- outputs:
- id: ${{ steps.pr.outputs.value }}
- ref: ${{ steps.ref.outputs.value }}
- repo: ${{ steps.repo.outputs.value }}
-
- steps:
- # Get PR id from artifact
- - name: download pr artifact
- uses: dawidd6/action-download-artifact@v2
- with:
- workflow: ${{ github.event.workflow_run.workflow_id }}
- run_id: ${{ github.event.workflow_run.id }}
- name: pr-id
-
- - name: get PR id
- id: pr
- run: echo "value=$(<pr-id.txt)" >> $GITHUB_OUTPUT
-
- # Get PR ref from artifact
- - name: download pr artifact
- uses: dawidd6/action-download-artifact@v2
- with:
- workflow: ${{ github.event.workflow_run.workflow_id }}
- run_id: ${{ github.event.workflow_run.id }}
- name: pr-ref
-
- - name: get PR ref
- id: ref
- run: echo "value=$(<pr-ref.txt)" >> $GITHUB_OUTPUT
-
- # Get PR repo from artifact
- - name: download pr artifact
- uses: dawidd6/action-download-artifact@v2
- with:
- workflow: ${{ github.event.workflow_run.workflow_id }}
- run_id: ${{ github.event.workflow_run.id }}
- name: pr-repo
-
- - name: get PR repo
- id: repo
- run: echo "value=$(<pr-repo.txt)" >> $GITHUB_OUTPUT
-
- prepare:
- runs-on: ubuntu-latest
- needs: [setup]
-
- steps:
- # ================= Create Comment =================
- - name: 🧽 Find And Delete Comment
- uses: peter-evans/find-comment@v2
- if: ${{ needs.setup.outputs.id != '' }}
- id: fc
- with:
- issue-number: ${{ needs.setup.outputs.id }}
- comment-author: 'github-actions[bot]'
- body-includes: View Deployment
-
- - name: 📝 Create or update comment
- uses: peter-evans/create-or-update-comment@v3
- if: ${{ needs.setup.outputs.id != '' }}
- with:
- comment-id: ${{ steps.fc.outputs.comment-id }}
- issue-number: ${{ needs.setup.outputs.id }}
- body: |
- ## Playwright Test Report
-
- [#${{ github.run_id }}](https://github.com/dream-num/univer/actions/runs/${{ github.run_id }})
-
- <p align="center">
- 🥐 🍔 🥓 🥗 🥘 🌯 🍚 🍛 🍖 🍭 🍧 🍝 🥪 🥖 🍪 <br />
- Still cooking, please come back later <br />
- 🥙 🥮 🥨 🌭 🍦 🍙 🍕 🍰 🍮 🍜 🍡 🍱 🍿 🍕 🥟
- </p>
- edit-mode: replace
-
e2e-test:
runs-on: ubuntu-latest
- needs: [setup]
- outputs:
- preview-url: ${{ steps.vercel-e2e-report.outputs.preview-url}}
+ env:
+ GH_TOKEN: ${{ github.token }}
steps:
- name: Checkout
uses: actions/checkout@v4
- with:
- repository: ${{ needs.setup.outputs.repo }}
- ref: ${{ needs.setup.outputs.ref }}
- name: Setup Node.js
uses: ./.github/actions/setup-node
@@ -121,29 +35,7 @@ jobs:
vercel-org-id: ${{ secrets.ORG_ID }}
vercel-project-id: ${{ secrets.PROJECT_ID_E2E}}
- notify:
- runs-on: ubuntu-latest
- needs: [setup, e2e-test]
-
- steps:
- # ================= Create Comment =================
- - name: 🧽 Find And Delete Comment
- uses: peter-evans/find-comment@v2
- if: ${{ needs.setup.outputs.id != '' }}
- id: fc
+ - uses: daun/playwright-report-summary@v3
with:
- issue-number: ${{ needs.setup.outputs.id }}
- comment-author: 'github-actions[bot]'
- body-includes: Playwright Test Report
-
- - name: 📝 Create or update comment
- uses: peter-evans/create-or-update-comment@v3
- if: ${{ needs.setup.outputs.id != '' }}
- with:
- comment-id: ${{ steps.fc.outputs.comment-id }}
- issue-number: ${{ needs.setup.outputs.id }}
- body: |
- ## Playwright Test Report
-
- [🔗 Report link](${{ needs.e2e-test.outputs.preview-url }}/)
- edit-mode: replace
+ report-file: playwright-report.json
+ custom-info: 'For more information, [see full report](${{ steps.vercel-e2e-report.outputs.preview-url }})'
diff --git a/.gitignore b/.gitignore
index caa96cd596..69f901dcf5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -110,6 +110,7 @@ storybook-static
/playwright-report/
/blob-report/
/playwright/.cache/
+playwright-report.json
*storybook.log
typedoc.json
diff --git a/examples/esbuild.config.mjs b/examples/esbuild.config.mjs
index 77dac4bda1..d3a7773fb8 100644
--- a/examples/esbuild.config.mjs
+++ b/examples/esbuild.config.mjs
@@ -1,14 +1,14 @@
-import './scripts/generate-locales.mjs';
+import { execSync } from 'node:child_process';
import path from 'node:path';
import process from 'node:process';
-import { execSync } from 'node:child_process';
import esbuild from 'esbuild';
import cleanPlugin from 'esbuild-plugin-clean';
import copyPlugin from 'esbuild-plugin-copy';
+import vue from 'esbuild-plugin-vue3';
import stylePlugin from 'esbuild-style-plugin';
import minimist from 'minimist';
-import vue from 'esbuild-plugin-vue3';
+import './scripts/generate-locales.mjs';
const nodeModules = path.resolve(process.cwd(), './node_modules');
@@ -25,8 +25,8 @@ const monacoEditorEntryPoints = [
];
// Get git commit hash and ref name
-const gitCommitHash = execSync('git rev-parse --short HEAD').toString().trim();
-const gitRefName = execSync('git symbolic-ref -q --short HEAD || git describe --tags --exact-match').toString().trim();
+const gitCommitHash = isE2E ? 'E2E' : execSync('git rev-parse --short HEAD').toString().trim();
+const gitRefName = isE2E ? 'E2E' : execSync('git symbolic-ref -q --short HEAD || git describe --tags --exact-match').toString().trim();
function monacoBuildTask() {
return esbuild.build({
diff --git a/playwright.config.ts b/playwright.config.ts
index 73c1ed437b..8310f37205 100644
--- a/playwright.config.ts
+++ b/playwright.config.ts
@@ -27,7 +27,10 @@ export default defineConfig({
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
- reporter: 'html',
+ reporter: [
+ ['json', { outputFile: 'playwright-report.json' }],
+ ['html'],
+ ],
outputDir: './playwright-report',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {