diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index b48ca2111..6ca91de24 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -8,7 +8,7 @@ on: push # List of jobs jobs: - chromatic-deployment: + visual_regression_check: runs-on: ubuntu-latest steps: @@ -27,7 +27,7 @@ jobs: uses: actions/setup-node@v5 with: node-version: ${{ env.NODE_VERSION }} - cache: 'pnpm' + cache: "pnpm" - name: Install dependencies run: pnpm install --frozen-lockfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebc9c8259..7cc6337b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,9 +9,13 @@ on: jobs: ci: runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + contents: read + pull-requests: write strategy: matrix: - task: [lint, test] + task: [lint, test, e2e] steps: - name: Checkout uses: actions/checkout@v5 @@ -30,6 +34,10 @@ jobs: - name: Install dependencies run: pnpm install + - name: Install Playwright Browsers + if: matrix.task == 'e2e' + run: pnpm playwright install --with-deps + - name: Run lint if: matrix.task == 'lint' run: pnpm lint:ci @@ -38,9 +46,53 @@ jobs: if: matrix.task == 'test' run: pnpm test:ci + - name: Run e2e tests + if: matrix.task == 'e2e' + env: + AIRTABLE_PAT: ${{ secrets.AIRTABLE_PAT }} + run: pnpm test:e2e:headless + - name: Upload coverage artifact if: matrix.task == 'test' && github.event_name == 'pull_request' uses: actions/upload-artifact@v4 with: name: vitest-coverage path: vitest-coverage + + - name: Upload Playwright report + if: matrix.task == 'e2e' && failure() + uses: actions/upload-artifact@v4 + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 + + - name: Comment PR with Playwright artifact link + if: matrix.task == 'e2e' && failure() && github.event_name == 'pull_request' + uses: actions/github-script@v7 + with: + script: | + const runId = context.runId; + const repo = context.repo; + const artifactUrl = `https://github.com/${repo.owner}/${repo.repo}/actions/runs/${runId}`; + + const comment = `## ❌ Playwright Tests Failed + + The Playwright tests have failed. Please download the test report artifact to see detailed information about the failures: + + 📊 [View test run and download artifact](${artifactUrl}) + + **How to view the report:** + 1. Click the link above + 2. Scroll to the bottom to the "Artifacts" section + 3. Download the \`playwright-report\` artifact + 4. Extract the zip file and open \`index.html\` in your browser + + The report includes screenshots, videos, and detailed traces of the failed tests.`; + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: repo.owner, + repo: repo.repo, + body: comment + }); diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml deleted file mode 100644 index 80b1e3084..000000000 --- a/.github/workflows/playwright.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Playwright Tests -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] -jobs: - test: - timeout-minutes: 60 - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: write - steps: - - uses: actions/checkout@v5 - - name: Install pnpm - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v5 - with: - node-version-file: ".nvmrc" - cache: "pnpm" - - name: Install dependencies - run: pnpm install --frozen-lockfile - - name: Install Playwright Browsers - run: pnpm playwright install --with-deps - - name: Run Playwright tests - env: - AIRTABLE_PAT: ${{ secrets.AIRTABLE_PAT }} - run: pnpm test:e2e:headless - - uses: actions/upload-artifact@v4 - if: failure() - id: artifact-upload - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 - - name: Comment PR with artifact link - if: failure() && github.event_name == 'pull_request' - uses: actions/github-script@v7 - with: - script: | - const runId = context.runId; - const repo = context.repo; - const artifactUrl = `https://github.com/${repo.owner}/${repo.repo}/actions/runs/${runId}`; - - const comment = `## ❌ Playwright Tests Failed - - The Playwright tests have failed. Please download the test report artifact to see detailed information about the failures: - - 📊 [View test run and download artifact](${artifactUrl}) - - **How to view the report:** - 1. Click the link above - 2. Scroll to the bottom to the "Artifacts" section - 3. Download the \`playwright-report\` artifact - 4. Extract the zip file and open \`index.html\` in your browser - - The report includes screenshots, videos, and detailed traces of the failed tests.`; - - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: repo.owner, - repo: repo.repo, - body: comment - }); diff --git a/.github/workflows/report_coverage.yml b/.github/workflows/report_coverage.yml index 6cd4ae237..1cfc35341 100644 --- a/.github/workflows/report_coverage.yml +++ b/.github/workflows/report_coverage.yml @@ -19,6 +19,7 @@ jobs: uses: actions/download-artifact@v4 with: name: vitest-coverage + path: vitest-coverage github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ github.event.workflow_run.id }}