-
Notifications
You must be signed in to change notification settings - Fork 11
102 lines (98 loc) · 3.2 KB
/
preview.yaml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review, closed]
jobs:
check:
runs-on: ubuntu-latest
if: ${{ contains('opened reopened synchronize ready_for_review', github.event.action) && !github.event.pull_request.merged }}
environment: Preview
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: exactly
SENTRY_PROJECT: webapp
SENTRY_ENVIRONMENT: development
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npx unimported
e2e:
needs: [check]
if: ${{ !github.event.pull_request.draft && github.event.action != 'closed' }}
timeout-minutes: 30
runs-on: ubuntu-latest
environment: Test
env:
NEXT_PUBLIC_SOCKET_API_KEY: ${{ secrets.NEXT_PUBLIC_SOCKET_API_KEY }}
TENDERLY_ACCESS_KEY: ${{ secrets.TENDERLY_ACCESS_KEY }}
TENDERLY_PROJECT: exactly
TENDERLY_USER: exactly
NODE_OPTIONS: '--max_old_space_size=4096'
strategy:
fail-fast: false
matrix:
shard: [1/4, 2/4, 3/4, 4/4]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- uses: actions/cache@v3
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- run: npm ci --audit false
- run: npm run build:e2e
- run: npx playwright install chromium --with-deps
- run: npx playwright test --project=chromium --shard ${{ matrix.shard }}
- if: always()
uses: actions/upload-artifact@v3
with:
name: blob-reports
path: blob-report
retention-days: 1
e2e-report:
needs: [e2e]
if: ${{ !cancelled() && !github.event.pull_request.draft && !github.event.pull_request.merged }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci --audit false
- uses: actions/download-artifact@v3
with:
name: blob-reports
path: blob-reports
- run: npx playwright merge-reports --reporter html ./blob-reports
- uses: actions/upload-artifact@v3
with:
name: html-report
path: playwright-report
retention-days: 30
e2e-report-publish:
needs: [e2e-report]
if: ${{ always() && github.event.action == 'closed' && github.event.pull_request.merged }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: html-report
path: html-report
- uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 569f3c4008862b4cc595f409db748f41
projectName: app-test
directory: html-report