Skip to content

Commit 0ceb96b

Browse files
authored
ci: ability to test against turbopack (#12652)
This adds a new `tests-e2e-turbo` CI step that runs our e2e test suite against turbo. This will ensure that we can guarantee full support for turbopack. Our CI runners are already at capacity, so the turbo steps will only run if the `tests-e2e-turbo` label is set on the PR.
1 parent 319d335 commit 0ceb96b

File tree

1 file changed

+137
-0
lines changed

1 file changed

+137
-0
lines changed

.github/workflows/main.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- opened
77
- reopened
88
- synchronize
9+
- labeled
910
push:
1011
branches:
1112
- main
@@ -383,6 +384,142 @@ jobs:
383384
# report-tag: ${{ matrix.suite }}
384385
# job-summary: true
385386

387+
tests-e2e-turbo:
388+
runs-on: ubuntu-24.04
389+
needs: [changes, build]
390+
if: >-
391+
needs.changes.outputs.needs_tests == 'true' &&
392+
(
393+
contains(github.event.pull_request.labels.*.name, 'run-e2e-turbo') ||
394+
github.event.label.name == 'run-e2e-turbo'
395+
)
396+
name: e2e-turbo-${{ matrix.suite }}
397+
strategy:
398+
fail-fast: false
399+
matrix:
400+
# find test -type f -name 'e2e.spec.ts' | sort | xargs dirname | xargs -I {} basename {}
401+
suite:
402+
- _community
403+
- access-control
404+
- admin__e2e__general
405+
- admin__e2e__list-view
406+
- admin__e2e__document-view
407+
- admin-bar
408+
- admin-root
409+
- auth
410+
- auth-basic
411+
- bulk-edit
412+
- joins
413+
- field-error-states
414+
- fields-relationship
415+
- fields__collections__Array
416+
- fields__collections__Blocks
417+
- fields__collections__Blocks#config.blockreferences.ts
418+
- fields__collections__Checkbox
419+
- fields__collections__Collapsible
420+
- fields__collections__ConditionalLogic
421+
- fields__collections__CustomID
422+
- fields__collections__Date
423+
- fields__collections__Email
424+
- fields__collections__Indexed
425+
- fields__collections__JSON
426+
- fields__collections__Number
427+
- fields__collections__Point
428+
- fields__collections__Radio
429+
- fields__collections__Relationship
430+
- fields__collections__Row
431+
- fields__collections__Select
432+
- fields__collections__Tabs
433+
- fields__collections__Tabs2
434+
- fields__collections__Text
435+
- fields__collections__UI
436+
- fields__collections__Upload
437+
- hooks
438+
- lexical__collections__Lexical__e2e__main
439+
- lexical__collections__Lexical__e2e__blocks
440+
- lexical__collections__Lexical__e2e__blocks#config.blockreferences.ts
441+
- lexical__collections__RichText
442+
- query-presets
443+
- form-state
444+
- live-preview
445+
- localization
446+
- locked-documents
447+
- i18n
448+
- plugin-cloud-storage
449+
- plugin-form-builder
450+
- plugin-import-export
451+
- plugin-nested-docs
452+
- plugin-seo
453+
- sort
454+
- versions
455+
- uploads
456+
env:
457+
SUITE_NAME: ${{ matrix.suite }}
458+
steps:
459+
- uses: actions/checkout@v4
460+
461+
- name: Node setup
462+
uses: ./.github/actions/setup
463+
with:
464+
node-version: ${{ env.NODE_VERSION }}
465+
pnpm-version: ${{ env.PNPM_VERSION }}
466+
pnpm-run-install: false
467+
pnpm-restore-cache: false # Full build is restored below
468+
pnpm-install-cache-key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
469+
470+
- name: Restore build
471+
uses: actions/cache@v4
472+
with:
473+
path: ./*
474+
key: ${{ github.sha }}-${{ github.run_number }}
475+
476+
- name: Start LocalStack
477+
run: pnpm docker:start
478+
if: ${{ matrix.suite == 'plugin-cloud-storage' }}
479+
480+
- name: Store Playwright's Version
481+
run: |
482+
# Extract the version number using a more targeted regex pattern with awk
483+
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --depth=0 | awk '/@playwright\/test/ {print $2}')
484+
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
485+
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
486+
487+
- name: Cache Playwright Browsers for Playwright's Version
488+
id: cache-playwright-browsers
489+
uses: actions/cache@v4
490+
with:
491+
path: ~/.cache/ms-playwright
492+
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
493+
494+
- name: Setup Playwright - Browsers and Dependencies
495+
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
496+
run: pnpm exec playwright install --with-deps chromium
497+
498+
- name: Setup Playwright - Dependencies-only
499+
if: steps.cache-playwright-browsers.outputs.cache-hit == 'true'
500+
run: pnpm exec playwright install-deps chromium
501+
502+
- name: E2E Tests
503+
run: PLAYWRIGHT_JSON_OUTPUT_NAME=results_${{ matrix.suite }}.json pnpm test:e2e:prod:ci:turbo ${{ matrix.suite }}
504+
env:
505+
PLAYWRIGHT_JSON_OUTPUT_NAME: results_${{ matrix.suite }}.json
506+
NEXT_TELEMETRY_DISABLED: 1
507+
508+
- uses: actions/upload-artifact@v4
509+
if: always()
510+
with:
511+
name: test-results-turbo${{ matrix.suite }}
512+
path: test/test-results/
513+
if-no-files-found: ignore
514+
retention-days: 1
515+
516+
# Disabled until this is fixed: https://github.com/daun/playwright-report-summary/issues/156
517+
# - uses: daun/playwright-report-summary@v3
518+
# with:
519+
# report-file: results_${{ matrix.suite }}.json
520+
# report-tag: ${{ matrix.suite }}
521+
# job-summary: true
522+
386523
# Build listed templates with packed local packages
387524
build-templates:
388525
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)