Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
235b4cd0
Unverified
Commit
235b4cd0
authored
Jan 25, 2021
by
JJ Kasper
Committed by
GitHub
Jan 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix docs only check for CI (#21530)
parent
d82672c3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
39 deletions
+42
-39
build_test_deploy.yml
.github/workflows/build_test_deploy.yml
+32
-32
pull_request_stats.yml
.github/workflows/pull_request_stats.yml
+2
-2
skip-docs-change.js
skip-docs-change.js
+8
-5
No files found.
.github/workflows/build_test_deploy.yml
View file @
235b4cd0
...
@@ -19,7 +19,7 @@ jobs:
...
@@ -19,7 +19,7 @@ jobs:
-
run
:
yarn install --frozen-lockfile --check-files
-
run
:
yarn install --frozen-lockfile --check-files
-
run
:
node run-tests.js --timings --write-timings -g 1/1
-
run
:
node run-tests.js --timings --write-timings -g 1/1
-
name
:
Check docs only change
-
name
:
Check docs only change
run
:
echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo '
docs-only
')
run
:
echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo '
not-docs-only-change
')
id
:
docs-change
id
:
docs-change
-
run
:
echo ${{steps.docs-change.outputs.DOCS_CHANGE}}
-
run
:
echo ${{steps.docs-change.outputs.DOCS_CHANGE}}
-
uses
:
actions/cache@v2
-
uses
:
actions/cache@v2
...
@@ -47,13 +47,13 @@ jobs:
...
@@ -47,13 +47,13 @@ jobs:
NEXT_TELEMETRY_DISABLED
:
1
NEXT_TELEMETRY_DISABLED
:
1
steps
:
steps
:
-
uses
:
actions/cache@v2
-
uses
:
actions/cache@v2
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
id
:
restore-build
id
:
restore-build
with
:
with
:
path
:
./*
path
:
./*
key
:
${{ github.sha }}
key
:
${{ github.sha }}
-
run
:
./check-pre-compiled.sh
-
run
:
./check-pre-compiled.sh
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
testUnit
:
testUnit
:
name
:
Test Unit
name
:
Test Unit
...
@@ -65,14 +65,14 @@ jobs:
...
@@ -65,14 +65,14 @@ jobs:
HEADLESS
:
true
HEADLESS
:
true
steps
:
steps
:
-
uses
:
actions/cache@v2
-
uses
:
actions/cache@v2
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
id
:
restore-build
id
:
restore-build
with
:
with
:
path
:
./*
path
:
./*
key
:
${{ github.sha }}
key
:
${{ github.sha }}
-
run
:
node run-tests.js --timings --type unit -g 1/1
-
run
:
node run-tests.js --timings --type unit -g 1/1
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
testIntegration
:
testIntegration
:
name
:
Test Integration
name
:
Test Integration
...
@@ -89,7 +89,7 @@ jobs:
...
@@ -89,7 +89,7 @@ jobs:
steps
:
steps
:
-
run
:
echo ${{needs.build.outputs.docsChange}}
-
run
:
echo ${{needs.build.outputs.docsChange}}
-
uses
:
actions/cache@v2
-
uses
:
actions/cache@v2
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
id
:
restore-build
id
:
restore-build
with
:
with
:
path
:
./*
path
:
./*
...
@@ -97,10 +97,10 @@ jobs:
...
@@ -97,10 +97,10 @@ jobs:
# TODO: remove after we fix watchpack watching too much
# 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
:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
-
run
:
xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/6 -c 3
-
run
:
xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/6 -c 3
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
testElectron
:
testElectron
:
name
:
Test Electron
name
:
Test Electron
...
@@ -113,7 +113,7 @@ jobs:
...
@@ -113,7 +113,7 @@ jobs:
TEST_ELECTRON
:
1
TEST_ELECTRON
:
1
steps
:
steps
:
-
uses
:
actions/cache@v2
-
uses
:
actions/cache@v2
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
id
:
restore-build
id
:
restore-build
with
:
with
:
path
:
./*
path
:
./*
...
@@ -121,13 +121,13 @@ jobs:
...
@@ -121,13 +121,13 @@ jobs:
# TODO: remove after we fix watchpack watching too much
# 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
:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
-
run
:
yarn add -W --dev spectron@7.0.0 electron@5.0.0
-
run
:
yarn add -W --dev spectron@7.0.0 electron@5.0.0
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
-
run
:
xvfb-run node run-tests.js test/integration/with-electron/test/index.test.js
-
run
:
xvfb-run node run-tests.js test/integration/with-electron/test/index.test.js
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
testYarnPnP
:
testYarnPnP
:
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
...
@@ -137,14 +137,14 @@ jobs:
...
@@ -137,14 +137,14 @@ jobs:
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
run
:
echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo '
docs-only
')
-
run
:
echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo '
not-docs-only-change
')
id
:
docs-change
id
:
docs-change
-
run
:
yarn install --frozen-lockfile --check-files
-
run
:
yarn install --frozen-lockfile --check-files
if
:
${{steps.docs-change.outputs.DOCS_CHANGE != 'docs
-only
'}}
if
:
${{steps.docs-change.outputs.DOCS_CHANGE != 'docs
only change
'}}
-
run
:
bash ./test-pnp.sh
-
run
:
bash ./test-pnp.sh
if
:
${{steps.docs-change.outputs.DOCS_CHANGE != 'docs
-only
'}}
if
:
${{steps.docs-change.outputs.DOCS_CHANGE != 'docs
only change
'}}
testsPass
:
testsPass
:
name
:
thank you, next
name
:
thank you, next
...
@@ -165,17 +165,17 @@ jobs:
...
@@ -165,17 +165,17 @@ jobs:
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
run
:
echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo '
docs-only
')
-
run
:
echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo '
not-docs-only-change
')
id
:
docs-change
id
:
docs-change
-
run
:
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
-
run
:
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
-only
' }}
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
only change
' }}
-
run
:
yarn install --check-files
-
run
:
yarn install --check-files
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
-only
' }}
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
only change
' }}
-
run
:
xvfb-run node run-tests.js test/integration/{link-ref,production,basic,async-modules,font-optimization,ssr-ctx}/test/index.test.js test/acceptance/*.test.js
-
run
:
xvfb-run node run-tests.js test/integration/{link-ref,production,basic,async-modules,font-optimization,ssr-ctx}/test/index.test.js test/acceptance/*.test.js
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
-only
' }}
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
only change
' }}
testLegacyReact
:
testLegacyReact
:
name
:
React 16 + Webpack 4 (Basic, Production, Acceptance)
name
:
React 16 + Webpack 4 (Basic, Production, Acceptance)
...
@@ -188,26 +188,26 @@ jobs:
...
@@ -188,26 +188,26 @@ jobs:
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
run
:
echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo '
docs-only
')
-
run
:
echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo '
not-docs-only-change
')
id
:
docs-change
id
:
docs-change
-
run
:
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
-
run
:
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
-only
' }}
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
only change
' }}
-
run
:
cat package.json | jq '.resolutions.react = "^16.14.0"' > package.json.tmp && mv package.json.tmp package.json
-
run
:
cat package.json | jq '.resolutions.react = "^16.14.0"' > package.json.tmp && mv package.json.tmp package.json
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
-only
' }}
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
only change
' }}
-
run
:
cat package.json | jq '.resolutions."react-dom" = "^16.14.0"' > package.json.tmp && mv package.json.tmp package.json
-
run
:
cat package.json | jq '.resolutions."react-dom" = "^16.14.0"' > package.json.tmp && mv package.json.tmp package.json
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
-only
' }}
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
only change
' }}
-
run
:
yarn install --check-files
-
run
:
yarn install --check-files
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
-only
' }}
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
only change
' }}
-
run
:
yarn list react react-dom
-
run
:
yarn list react react-dom
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
-only
' }}
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
only change
' }}
-
run
:
xvfb-run node run-tests.js test/integration/{link-ref,production,basic,async-modules,font-optimization,ssr-ctx,worker-loader}/test/index.test.js test/acceptance/*.test.js
-
run
:
xvfb-run node run-tests.js test/integration/{link-ref,production,basic,async-modules,font-optimization,ssr-ctx,worker-loader}/test/index.test.js test/acceptance/*.test.js
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
-only
' }}
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
only change
' }}
testFirefox
:
testFirefox
:
name
:
Test Firefox (production)
name
:
Test Firefox (production)
...
@@ -219,13 +219,13 @@ jobs:
...
@@ -219,13 +219,13 @@ jobs:
NEXT_TELEMETRY_DISABLED
:
1
NEXT_TELEMETRY_DISABLED
:
1
steps
:
steps
:
-
uses
:
actions/cache@v2
-
uses
:
actions/cache@v2
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
id
:
restore-build
id
:
restore-build
with
:
with
:
path
:
./*
path
:
./*
key
:
${{ github.sha }}
key
:
${{ github.sha }}
-
run
:
node run-tests.js test/integration/production/test/index.test.js
-
run
:
node run-tests.js test/integration/production/test/index.test.js
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
testSafari
:
testSafari
:
name
:
Test Safari (production)
name
:
Test Safari (production)
...
@@ -240,13 +240,13 @@ jobs:
...
@@ -240,13 +240,13 @@ jobs:
BROWSERSTACK_ACCESS_KEY
:
${{ secrets.BROWSERSTACK_ACCESS_KEY }}
BROWSERSTACK_ACCESS_KEY
:
${{ secrets.BROWSERSTACK_ACCESS_KEY }}
steps
:
steps
:
-
uses
:
actions/cache@v2
-
uses
:
actions/cache@v2
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
id
:
restore-build
id
:
restore-build
with
:
with
:
path
:
./*
path
:
./*
key
:
${{ github.sha }}
key
:
${{ github.sha }}
-
run
:
'
[[
-z
"$BROWSERSTACK_ACCESS_KEY"
]]
&&
echo
"Skipping
for
PR"
||
node
run-tests.js
test/integration/production/test/index.test.js'
-
run
:
'
[[
-z
"$BROWSERSTACK_ACCESS_KEY"
]]
&&
echo
"Skipping
for
PR"
||
node
run-tests.js
test/integration/production/test/index.test.js'
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
testSafariOld
:
testSafariOld
:
name
:
Test Safari 10.1 (nav)
name
:
Test Safari 10.1 (nav)
...
@@ -262,13 +262,13 @@ jobs:
...
@@ -262,13 +262,13 @@ jobs:
BROWSERSTACK_ACCESS_KEY
:
${{ secrets.BROWSERSTACK_ACCESS_KEY }}
BROWSERSTACK_ACCESS_KEY
:
${{ secrets.BROWSERSTACK_ACCESS_KEY }}
steps
:
steps
:
-
uses
:
actions/cache@v2
-
uses
:
actions/cache@v2
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
id
:
restore-build
id
:
restore-build
with
:
with
:
path
:
./*
path
:
./*
key
:
${{ github.sha }}
key
:
${{ github.sha }}
-
run
:
'
[[
-z
"$BROWSERSTACK_ACCESS_KEY"
]]
&&
echo
"Skipping
for
PR"
||
node
run-tests.js
test/integration/production-nav/test/index.test.js'
-
run
:
'
[[
-z
"$BROWSERSTACK_ACCESS_KEY"
]]
&&
echo
"Skipping
for
PR"
||
node
run-tests.js
test/integration/production-nav/test/index.test.js'
if
:
${{needs.build.outputs.docsChange != 'docs
-only
'}}
if
:
${{needs.build.outputs.docsChange != 'docs
only change
'}}
publishRelease
:
publishRelease
:
name
:
Potentially publish release
name
:
Potentially publish release
...
...
.github/workflows/pull_request_stats.yml
View file @
235b4cd0
...
@@ -10,7 +10,7 @@ jobs:
...
@@ -10,7 +10,7 @@ jobs:
runs-on
:
ubuntu-latest
runs-on
:
ubuntu-latest
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
run
:
echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo '
docs-only
')
-
run
:
echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo '
not-docs-only-change
')
id
:
docs-change
id
:
docs-change
-
uses
:
./.github/actions/next-stats-action
-
uses
:
./.github/actions/next-stats-action
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
-only
' }}
if
:
${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs
only change
' }}
skip-docs-change.js
View file @
235b4cd0
...
@@ -7,15 +7,18 @@ const DOCS_FOLDERS = ['bench', 'docs', 'errors', 'examples']
...
@@ -7,15 +7,18 @@ const DOCS_FOLDERS = ['bench', 'docs', 'errors', 'examples']
async
function
main
()
{
async
function
main
()
{
await
exec
(
'git fetch origin canary'
)
await
exec
(
'git fetch origin canary'
)
const
{
stdout
:
changedFilesOutput
}
=
await
exec
(
const
{
stdout
:
changedFilesOutput
}
=
await
exec
(
'git diff
$(git merge-base --fork-point canary)
--name-only'
'git diff
origin/canary
--name-only'
)
)
const
changedFiles
=
changedFilesOutput
const
changedFiles
=
changedFilesOutput
.
split
(
'
\
n'
)
.
split
(
'
\
n'
)
.
map
((
file
)
=>
file
&&
file
.
trim
())
.
map
((
file
)
=>
file
&&
file
.
trim
())
.
filter
(
Boolean
)
.
filter
(
Boolean
)
let
hasNonDocsChange
=
changedFiles
.
some
((
file
)
=>
{
let
hasNonDocsChange
=
!
changedFiles
.
length
||
changedFiles
.
some
((
file
)
=>
{
return
!
DOCS_FOLDERS
.
some
((
folder
)
=>
file
.
startsWith
(
folder
+
'/'
))
return
!
DOCS_FOLDERS
.
some
((
folder
)
=>
file
.
startsWith
(
folder
+
'/'
))
})
})
...
@@ -41,7 +44,7 @@ async function main() {
...
@@ -41,7 +44,7 @@ async function main() {
cmd
.
on
(
'error'
,
(
err
)
=>
reject
(
err
))
cmd
.
on
(
'error'
,
(
err
)
=>
reject
(
err
))
})
})
}
else
{
}
else
{
console
.
log
(
'
Only docs changes exiting...
'
)
console
.
log
(
'
docs only change
'
)
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment