forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (119 loc) · 3.32 KB
/
build_test_deploy.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
on:
push:
branches: [canary]
pull_request:
types: [opened, synchronize]
name: Build, test, and deploy
jobs:
build:
runs-on: ubuntu-latest
env:
NEXT_TELEMETRY_DISABLED: 1
steps:
- uses: actions/checkout@v2
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- run: yarn install --frozen-lockfile --check-files
- uses: actions/cache@v1
id: cache-build
with:
path: '.'
key: ${{ github.sha }}
lint:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/cache@v1
id: restore-build
with:
path: '.'
key: ${{ github.sha }}
- run: yarn lint
testAll:
name: Test All
runs-on: ubuntu-latest
needs: build
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
HEADLESS: true
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5, 6]
steps:
- uses: actions/cache@v1
id: restore-build
with:
path: '.'
key: ${{ github.sha }}
# TODO: remove after we fix watchpack watching too much
- run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- run: node run-tests.js --timings -g ${{ matrix.group }}/6 -c 3
testsPass:
name: thank you, next
runs-on: ubuntu-latest
needs: [lint, testAll]
steps:
- run: exit 0
testFirefox:
name: Test Firefox (production)
runs-on: ubuntu-latest
needs: build
env:
NEXT_TELEMETRY_DISABLED: 1
HEADLESS: true
steps:
- uses: actions/cache@v1
id: restore-build
with:
path: '.'
key: ${{ github.sha }}
- run: yarn testfirefox --forceExit test/integration/production/
testSafari:
name: Test Safari (production)
runs-on: ubuntu-latest
needs: build
env:
BROWSERSTACK: true
NEXT_TELEMETRY_DISABLED: 1
SKIP_LOCAL_SELENIUM_SERVER: true
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
steps:
- uses: actions/cache@v1
id: restore-build
with:
path: '.'
key: ${{ github.sha }}
- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || yarn testsafari --forceExit test/integration/production/'
testSafariOld:
name: Test Safari 10.1 (nav)
runs-on: ubuntu-latest
needs: [build, testSafari]
env:
BROWSERSTACK: true
LEGACY_SAFARI: true
NEXT_TELEMETRY_DISABLED: 1
SKIP_LOCAL_SELENIUM_SERVER: true
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
steps:
- uses: actions/cache@v1
id: restore-build
with:
path: '.'
key: ${{ github.sha }}
- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || yarn testsafari --forceExit test/integration/production-nav/'
publishRelease:
name: Potentially publish release
runs-on: ubuntu-latest
needs: [testsPass]
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/cache@v1
id: restore-build
with:
path: '.'
key: ${{ github.sha }}
- run: ./publish-release.sh