From de1ad4c12581f4a4490cb658af3205052b64acca Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Sat, 4 May 2024 19:11:15 -0700 Subject: [PATCH] split up matrix --- .github/workflows/nightly-release.yml | 8 +- .github/workflows/test.yml | 134 ++++++++++++++++++++++++-- 2 files changed, 132 insertions(+), 10 deletions(-) diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index d7f2a49f8e5..09adfc1626d 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -1,10 +1,10 @@ name: Nightly Release Branch on: # remove the [] when this is turned on - schedule: - [] - # Run daily at 2:30am UTC - # - cron: '30 2 * * 1-5' + [] + # Run daily at 2:30am UTC + # schedule: + # - cron: '30 2 * * 1-5' jobs: release: # prevents this action from running on forks diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 80ca6daf9d3..536f108a160 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -87,12 +87,79 @@ jobs: events-mode: ['legacy-events', 'modern-events'] test-prefix: ['test-e2e-'] include: - - browser: chromium - events-mode: modern-events - os: macos-latest - test-prefix: test-e2e-prod - - events-mode: modern-events - editor-mode: rich-text-with-collab + - os: macos-latest + browser: webkit + - os: macos-latest + playwright-cache: | + ~/Library/Caches/ms-playwright + test-results: | + test-results/ + - os: windows-latest + playwright-cache: | + C:\Users\runneradmin\AppData\Local\ms-playwright + test-results: | + ~/.npm/_logs/ + - os: ubuntu-latest + playwright-cache: | + ~/.cache/ms-playwright + test-results: | + test-results/ + runs-on: ${{ matrix.os }} + env: + CI: true + E2E_EDITOR_MODE: ${{ matrix.editor-mode }} + E2E_EVENTS_MODE: ${{ matrix.events-mode }} + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: npm + - name: Install required ubuntu-latest packages + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install xvfb + - name: Install dependencies + run: npm ci + - name: Restore playwright from cache + uses: actions/cache/restore@v4 + id: playwright-cache + with: + path: ${{ matrix.playwright-cache }} + key: playwright-${{ matrix.node-version }}-${{ runner.os }}-${{ runner.arch }}-v${{ secrets.CACHE_VERSION }}-${{ hashFiles('package-lock.json') }} + - name: Install playwright + run: npx playwright install + - name: Save playwright to cache + uses: actions/cache/save@v4 + if: steps.playwright-cache.outputs.cache-hit != 'true' + with: + path: ${{ matrix.playwright-cache }} + key: ${{ steps.playwright-cache.outputs.cache-primary-key }} + - name: Run tests + run: npm run ${{ matrix.test-prefix }}${{ matrix.editor-mode == 'rich-text-with-collab' && 'collab-' || '' }}ci-${{ matrix.browser }} + - name: Upload Artifacts + if: failure() + uses: actions/upload-artifact@v4 + with: + name: Test Results + path: ${{ matrix.test-results }} + retention-days: 7 + + e2e-collab: + if: github.repository_owner == 'facebook' + strategy: + matrix: + os: ['macos-latest', 'ubuntu-latest', 'windows-latest'] + node-version: [18.18.0] + browser: ['chromium', 'firefox'] + editor-mode: ['rich-text-with-collab'] + events-mode: ['modern-events'] + test-prefix: ['test-e2e-'] + include: + - os: macos-latest + browser: webkit - os: macos-latest playwright-cache: | ~/Library/Caches/ms-playwright @@ -151,3 +218,58 @@ jobs: name: Test Results path: ${{ matrix.test-results }} retention-days: 7 + + e2e-prod: + if: github.repository_owner == 'facebook' + strategy: + matrix: + os: ['macos-latest'] + node-version: [18.18.0] + browser: ['chromium'] + editor-mode: ['rich-text', 'plain-text', 'rich-text-with-collab'] + events-mode: ['modern-events'] + test-prefix: ['test-e2e-prod'] + include: + - os: macos-latest + playwright-cache: | + ~/Library/Caches/ms-playwright + test-results: | + test-results/ + browser: webkit + runs-on: ${{ matrix.os }} + env: + CI: true + E2E_EDITOR_MODE: ${{ matrix.editor-mode }} + E2E_EVENTS_MODE: ${{ matrix.events-mode }} + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: npm + - name: Install dependencies + run: npm ci + - name: Restore playwright from cache + uses: actions/cache/restore@v4 + id: playwright-cache + with: + path: ${{ matrix.playwright-cache }} + key: playwright-${{ matrix.node-version }}-${{ runner.os }}-${{ runner.arch }}-v${{ secrets.CACHE_VERSION }}-${{ hashFiles('package-lock.json') }} + - name: Install playwright + run: npx playwright install + - name: Save playwright to cache + uses: actions/cache/save@v4 + if: steps.playwright-cache.outputs.cache-hit != 'true' + with: + path: ${{ matrix.playwright-cache }} + key: ${{ steps.playwright-cache.outputs.cache-primary-key }} + - name: Run tests + run: npm run ${{ matrix.test-prefix }}${{ matrix.editor-mode == 'rich-text-with-collab' && 'collab-' || '' }}ci-${{ matrix.browser }} + - name: Upload Artifacts + if: failure() + uses: actions/upload-artifact@v4 + with: + name: Test Results + path: ${{ matrix.test-results }} + retention-days: 7