-
Notifications
You must be signed in to change notification settings - Fork 27.1k
81 lines (70 loc) · 2.51 KB
/
test_e2e_deploy_related.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Test E2E (Vercel Deploy), related
on:
pull_request:
types: [opened, synchronize]
jobs:
test:
if: '!github.event.pull_request.head.repo.fork'
runs-on: ubuntu-latest
env:
CARGO_PROFILE_RELEASE_LTO: 'true'
DATADOG_API_KEY: ${{ secrets.DATA_DOG_API_KEY }}
DD_ENV: 'ci'
NAPI_CLI_VERSION: 2.16.2
NEXT_JUNIT_TEST_REPORT: 'true'
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
NEXT_TEST_MODE: 'deploy'
NODE_LTS_VERSION: 20
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
TURBO_REMOTE_ONLY: 'true'
TURBO_TEAM: 'vercel'
TURBO_VERSION: 1.13.3-canary.2
VERCEL_TEST_TEAM: vtest314-next-e2e-tests
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
strategy:
fail-fast: false
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- name: Setup pnpm
run: corepack enable
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 25
- name: Setup tests
run: |
pnpm install
pnpm run build
npm i -g vercel@latest
node scripts/run-e2e-test-project-reset.mjs
- name: Run tests
run: |
docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.41.2-jammy /bin/bash -c "cd /work && \
NODE_VERSION=${{ env.NODE_LTS_VERSION }} ./scripts/setup-node.sh && \
corepack enable > /dev/null && \
NEXT_JUNIT_TEST_REPORT=${{ env.NEXT_JUNIT_TEST_REPORT }} \
DATADOG_API_KEY=${{ env.DATADOG_API_KEY }} \
DD_ENV=${{ env.DD_ENV }} \
VERCEL_TEST_TOKEN=${{ env.VERCEL_TEST_TOKEN }} \
VERCEL_TEST_TEAM=${{ env.VERCEL_TEST_TEAM }} \
NEXT_TEST_JOB=${{ env.NEXT_TEST_JOB }} \
NEXT_TEST_MODE=${{ env.NEXT_TEST_MODE }} \
TEST_TIMINGS_TOKEN=${{ env.TEST_TIMINGS_TOKEN }} \
xvfb-run node run-tests.js --related --timings -c 1 >> /proc/1/fd/1"
- name: Save test report as artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports
if-no-files-found: ignore
retention-days: 2
path: test/test-junit-report
- name: Upload test report to Datadog
continue-on-error: true
run: |
pnpx @datadog/[email protected] junit upload --tags test.type:nextjs_deploy_e2e --service nextjs ./test/test-junit-report