Skip to content

Commit ebebb6a

Browse files
authored
CI: add manual workflow for running e2e on prod (#56738)
This PR adds a job to the `build-and-deploy` workflow so that we run e2e tests on production/vercel if the job was dispatched manually. This is useful if you need to double-check your PR since we don't run them on production for every PRs. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
1 parent f2ce230 commit ebebb6a

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/build_and_deploy.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,40 @@ jobs:
511511
jrm ./nextjs-test-result-junit.xml "test/test-junit-report/**/*.xml"
512512
DD_ENV=ci datadog-ci junit upload --tags test.type:nextjs_deploy_e2e --service nextjs ./nextjs-test-result-junit.xml
513513
514+
manualTestDeployE2E:
515+
name: E2E (manual deploy)
516+
runs-on: ubuntu-latest
517+
if: ${{ github.event_name == 'workflow_dispatch' }}
518+
needs:
519+
- build
520+
- build-wasm
521+
- build-native
522+
env:
523+
NEXT_TELEMETRY_DISABLED: 1
524+
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
525+
VERCEL_TEST_TEAM: vtest314-next-e2e-tests
526+
DATADOG_API_KEY: ${{ secrets.DATA_DOG_API_KEY }}
527+
steps:
528+
- uses: actions/cache@v3
529+
timeout-minutes: 5
530+
id: restore-build
531+
with:
532+
path: ./*
533+
key: ${{ github.sha }}-${{ github.run_number }}
534+
535+
- run: npm i -g vercel@latest
536+
537+
- uses: actions/download-artifact@v3
538+
with:
539+
name: next-swc-binaries
540+
path: packages/next-swc/native
541+
542+
- run: RESET_VC_PROJECT=true node scripts/reset-vercel-project.mjs
543+
name: Reset test project
544+
545+
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.35.1-jammy /bin/bash -c "cd /work && NODE_VERSION=${{ env.NODE_LTS_VERSION }} ./scripts/setup-node.sh && corepack enable > /dev/null && DATADOG_TRACE_NEXTJS_TEST=TRUE DATADOG_API_KEY=${DATADOG_API_KEY} DD_ENV=ci VERCEL_TEST_TOKEN=${{ secrets.VERCEL_TEST_TOKEN }} VERCEL_TEST_TEAM=vtest314-next-e2e-tests NEXT_TEST_JOB=1 NEXT_TEST_MODE=deploy TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} NEXT_TEST_CONTINUE_ON_ERROR=1 xvfb-run node run-tests.js --type e2e >> /proc/1/fd/1"
546+
name: Run test/e2e (deploy)
547+
514548
releaseStats:
515549
name: Release Stats
516550
runs-on:

0 commit comments

Comments
 (0)