From 6b1270fa3c729c95bd11899548fdb6ae3fbe9c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemek=20Wi=C4=99ch?= Date: Sat, 9 May 2026 22:11:42 +0200 Subject: [PATCH] Don't run tests in deploy github actions Tests already run on all commits. --- .github/workflows/deploy-gh-pages.yml | 28 ---------------------- .github/workflows/deploy-wikitree-apps.yml | 28 ---------------------- docs/PLAYWRIGHT_DESIGN.md | 7 +++--- 3 files changed, 3 insertions(+), 60 deletions(-) diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml index d9e0e21..73b6e96 100644 --- a/.github/workflows/deploy-gh-pages.yml +++ b/.github/workflows/deploy-gh-pages.yml @@ -17,35 +17,7 @@ jobs: cache: 'npm' - run: npm ci - run: npm run build - - run: npm test - - name: Get Playwright version - id: playwright-version - run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT - - name: Cache Playwright Browsers - id: cache-playwright - uses: actions/cache@v4 - with: - path: ~/.cache/ms-playwright - key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} - - - name: Install Playwright System Dependencies - run: npx playwright install-deps chromium - - - name: Install Playwright Browsers (If Not Cached) - if: steps.cache-playwright.outputs.cache-hit != 'true' - run: npx playwright install chromium - - - name: Run E2E Tests - run: npm run test:e2e - - - name: Upload Playwright report - if: always() - uses: actions/upload-artifact@v4 - with: - name: playwright-report-gh-pages - path: playwright-report/ - retention-days: 30 - name: Deploy run: | git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git diff --git a/.github/workflows/deploy-wikitree-apps.yml b/.github/workflows/deploy-wikitree-apps.yml index b4015b2..e67ceef 100644 --- a/.github/workflows/deploy-wikitree-apps.yml +++ b/.github/workflows/deploy-wikitree-apps.yml @@ -17,35 +17,7 @@ jobs: cache: 'npm' - run: npm ci - run: npm run build - - run: npm test - - name: Get Playwright version - id: playwright-version - run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT - - name: Cache Playwright Browsers - id: cache-playwright - uses: actions/cache@v4 - with: - path: ~/.cache/ms-playwright - key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} - - - name: Install Playwright System Dependencies - run: npx playwright install-deps chromium - - - name: Install Playwright Browsers (If Not Cached) - if: steps.cache-playwright.outputs.cache-hit != 'true' - run: npx playwright install chromium - - - name: Run E2E Tests - run: npm run test:e2e - - - name: Upload Playwright report - if: always() - uses: actions/upload-artifact@v4 - with: - name: playwright-report-wikitree - path: playwright-report/ - retention-days: 30 - name: Install lftp run: sudo apt-get install -y lftp - name: Set up ssh diff --git a/docs/PLAYWRIGHT_DESIGN.md b/docs/PLAYWRIGHT_DESIGN.md index abff9e3..24a6edb 100644 --- a/docs/PLAYWRIGHT_DESIGN.md +++ b/docs/PLAYWRIGHT_DESIGN.md @@ -118,9 +118,9 @@ This section defines the granular step-by-step instructions and enumerates **eve * **[.github/workflows/node.js.yml](../.github/workflows/node.js.yml)** * *Rationale:* Replace `npm run cy:start-and-run` with cached Playwright execution. E2E tests are executed across all matrix Node environments to maximize testing coverage and parity across runtimes. * **[.github/workflows/deploy-gh-pages.yml](../.github/workflows/deploy-gh-pages.yml)** - * *Rationale:* Replace `npm run cy:start-and-run` with cached Playwright execution. Critically, the production build step does NOT use `VITE_GOOGLE_ANALYTICS: "false"` so that Google Analytics is preserved on the deployed live site. Instead, we rely entirely on Playwright's network-level interception to block all tracking requests during E2E testing. + * *Rationale:* Remove testing and browser-setup steps entirely to speed up the deployment flow and separate deploy actions from regular test gating. * **[.github/workflows/deploy-wikitree-apps.yml](../.github/workflows/deploy-wikitree-apps.yml)** - * *Rationale:* Replace `npm run cy:start-and-run` with cached Playwright execution, ensuring Google Analytics is NOT stripped from the deployed production bundle. Playwright's network interception handles all traffic isolation safely during E2E tests. + * *Rationale:* Remove testing and browser-setup steps entirely to speed up the deployment flow and separate deploy actions from regular test gating. #### 3. Files to [NEW] @@ -249,8 +249,7 @@ Modify the GitHub Actions YAML scripts in `.github/workflows/` to replace all le * **Artifact Storage**: Archive the resulting `playwright-report/` directory on failure or completion using `actions/upload-artifact@v4` with a 30-day retention period. ##### 2. Key Steps for `deploy-gh-pages.yml` & `deploy-wikitree-apps.yml` -* Integrate identical caching, dependency installation, execution (`npm run test:e2e`), and artifact storage steps to gate staging/production deployments. -* Crucially, do **NOT** disable Google Analytics during the app building phase (`VITE_GOOGLE_ANALYTICS` should not be modified), since Playwright's built-in network router handles isolating tracking traffic securely during testing. +* No testing steps are run within the deploy workflows. They are fully streamlined to execute checkouts, build production assets, and deploy immediately, leaving gating assertions to the primary merge-to-master CI loop (`node.js.yml`). ## 5. Future Considerations