|
| 1 | +name: test-e2e-deploy |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # run every day at midnight |
| 6 | + - cron: '0 0 * * *' |
| 7 | + # allow triggering manually as well |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + if: github.repository_owner == 'vercel' |
| 13 | + runs-on: ubuntu-latest |
| 14 | + |
| 15 | + env: |
| 16 | + VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }} |
| 17 | + VERCEL_TEST_TEAM: vtest314-next-e2e-tests |
| 18 | + DATADOG_API_KEY: ${{ secrets.DATA_DOG_API_KEY }} |
| 19 | + NAPI_CLI_VERSION: 2.16.2 |
| 20 | + TURBO_VERSION: 1.13.2 |
| 21 | + NODE_LTS_VERSION: 20 |
| 22 | + CARGO_PROFILE_RELEASE_LTO: 'true' |
| 23 | + TURBO_TEAM: 'vercel' |
| 24 | + TURBO_REMOTE_ONLY: 'true' |
| 25 | + TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }} |
| 26 | + NEXT_TELEMETRY_DISABLED: 1 |
| 27 | + |
| 28 | + strategy: |
| 29 | + fail-fast: false |
| 30 | + matrix: |
| 31 | + group: [1, 2] |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Setup node |
| 35 | + uses: actions/setup-node@v4 |
| 36 | + with: |
| 37 | + node-version: ${{ env.NODE_LTS_VERSION }} |
| 38 | + check-latest: true |
| 39 | + - run: corepack enable |
| 40 | + |
| 41 | + - uses: actions/checkout@v4 |
| 42 | + with: |
| 43 | + fetch-depth: 25 |
| 44 | + |
| 45 | + - run: pnpm install |
| 46 | + |
| 47 | + - run: pnpm run build |
| 48 | + |
| 49 | + - run: npm i -g vercel@latest |
| 50 | + |
| 51 | + - run: node scripts/run-e2e-test-project-reset.mjs |
| 52 | + name: Reset test project |
| 53 | + |
| 54 | + - 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 && NEXT_JUNIT_TEST_REPORT=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 }} xvfb-run node run-tests.js --type e2e --timings -g ${{ matrix.group }}/2 -c 1 >> /proc/1/fd/1" |
| 55 | + name: Run test/e2e (deploy) |
| 56 | + |
| 57 | + - name: Upload test report |
| 58 | + if: always() |
| 59 | + uses: actions/upload-artifact@v4 |
| 60 | + with: |
| 61 | + name: test-reports |
| 62 | + if-no-files-found: ignore |
| 63 | + retention-days: 2 |
| 64 | + path: | |
| 65 | + test/test-junit-report |
| 66 | +
|
| 67 | + - name: Upload test report to datadog |
| 68 | + continue-on-error: true |
| 69 | + run: | |
| 70 | + ls -al ./test/*junit |
| 71 | +
|
| 72 | + DD_ENV=ci npx @datadog/datadog-ci@2.23.1 junit upload --tags test.type:nextjs_deploy_e2e --service nextjs ./test/test-junit-report |
0 commit comments