2020-01-27 21:07:31 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [canary]
|
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize]
|
|
|
|
|
|
|
|
name: Build, test, and deploy
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2020-01-28 05:48:52 +01:00
|
|
|
env:
|
|
|
|
NEXT_TELEMETRY_DISABLED: 1
|
2020-01-27 21:07:31 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-01-28 05:48:52 +01:00
|
|
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
2020-01-27 21:07:31 +01:00
|
|
|
- run: yarn install --frozen-lockfile --check-files
|
2020-11-10 18:25:50 +01:00
|
|
|
- run: node run-tests.js --timings --write-timings -g 1/1
|
2020-07-23 06:06:50 +02:00
|
|
|
- uses: actions/cache@v2
|
2020-01-27 21:07:31 +01:00
|
|
|
id: cache-build
|
|
|
|
with:
|
2020-07-23 06:06:50 +02:00
|
|
|
path: ./*
|
2020-01-27 21:07:31 +01:00
|
|
|
key: ${{ github.sha }}
|
|
|
|
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
steps:
|
2020-07-23 06:06:50 +02:00
|
|
|
- uses: actions/cache@v2
|
2020-01-27 21:07:31 +01:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2020-07-23 06:06:50 +02:00
|
|
|
path: ./*
|
2020-01-27 21:07:31 +01:00
|
|
|
key: ${{ github.sha }}
|
|
|
|
- run: yarn lint
|
|
|
|
|
2020-04-07 15:42:16 +02:00
|
|
|
checkPrecompiled:
|
|
|
|
name: Check Pre-compiled
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
env:
|
|
|
|
NEXT_TELEMETRY_DISABLED: 1
|
|
|
|
steps:
|
2020-07-23 06:06:50 +02:00
|
|
|
- uses: actions/cache@v2
|
2020-04-07 15:42:16 +02:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2020-07-23 06:06:50 +02:00
|
|
|
path: ./*
|
2020-04-07 15:42:16 +02:00
|
|
|
key: ${{ github.sha }}
|
|
|
|
- run: ./check-pre-compiled.sh
|
|
|
|
|
2020-11-10 18:25:50 +01:00
|
|
|
testUnit:
|
|
|
|
name: Test Unit
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
env:
|
|
|
|
NEXT_TELEMETRY_DISABLED: 1
|
|
|
|
NEXT_TEST_JOB: 1
|
|
|
|
HEADLESS: true
|
|
|
|
steps:
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
id: restore-build
|
|
|
|
with:
|
|
|
|
path: ./*
|
|
|
|
key: ${{ github.sha }}
|
|
|
|
|
|
|
|
- run: node run-tests.js --timings --type unit -g 1/1
|
|
|
|
|
|
|
|
testIntegration:
|
|
|
|
name: Test Integration
|
2020-01-27 21:07:31 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
2020-01-28 05:48:52 +01:00
|
|
|
env:
|
|
|
|
NEXT_TELEMETRY_DISABLED: 1
|
2020-03-04 09:54:49 +01:00
|
|
|
NEXT_TEST_JOB: 1
|
2020-01-28 05:48:52 +01:00
|
|
|
HEADLESS: true
|
2020-01-27 21:07:31 +01:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
group: [1, 2, 3, 4, 5, 6]
|
|
|
|
steps:
|
2020-07-23 06:06:50 +02:00
|
|
|
- uses: actions/cache@v2
|
2020-01-27 21:07:31 +01:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2020-07-23 06:06:50 +02:00
|
|
|
path: ./*
|
2020-01-27 21:07:31 +01:00
|
|
|
key: ${{ github.sha }}
|
2020-02-01 01:57:58 +01:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2020-11-03 22:18:02 +01:00
|
|
|
- run: xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/6 -c 3
|
2020-01-27 21:07:31 +01:00
|
|
|
|
2020-11-05 21:45:21 +01:00
|
|
|
testElectron:
|
|
|
|
name: Test Electron
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
env:
|
|
|
|
NEXT_TELEMETRY_DISABLED: 1
|
|
|
|
NEXT_TEST_JOB: 1
|
|
|
|
HEADLESS: true
|
|
|
|
TEST_ELECTRON: 1
|
|
|
|
steps:
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
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: yarn add -W --dev spectron@7.0.0 electron@5.0.0
|
|
|
|
|
|
|
|
- run: xvfb-run node run-tests.js test/integration/with-electron/test/index.test.js
|
|
|
|
|
2020-08-17 19:39:57 +02:00
|
|
|
testYarnPnP:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
NODE_OPTIONS: '--unhandled-rejections=strict'
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- run: yarn install --frozen-lockfile --check-files
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
mkdir -p ./e2e-tests/next-pnp
|
|
|
|
cp -r ./examples/with-typescript/. ./e2e-tests/next-pnp
|
|
|
|
cd ./e2e-tests/next-pnp
|
|
|
|
touch yarn.lock
|
|
|
|
yarn set version berry
|
|
|
|
yarn config set pnpFallbackMode none
|
|
|
|
yarn link --all --private ../..
|
|
|
|
yarn build
|
|
|
|
|
2020-01-27 21:07:31 +01:00
|
|
|
testsPass:
|
2020-01-27 21:19:44 +01:00
|
|
|
name: thank you, next
|
2020-01-27 21:07:31 +01:00
|
|
|
runs-on: ubuntu-latest
|
2020-11-10 18:25:50 +01:00
|
|
|
needs: [lint, checkPrecompiled, testIntegration, testUnit, testYarnPnP]
|
2020-01-27 21:07:31 +01:00
|
|
|
steps:
|
|
|
|
- run: exit 0
|
|
|
|
|
2020-09-01 17:29:25 +02:00
|
|
|
testFutureDependencies:
|
|
|
|
name: React 17 + webpack 5 (Basic, Production, Acceptance)
|
2020-07-30 01:19:32 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
NEXT_TELEMETRY_DISABLED: 1
|
|
|
|
NEXT_TEST_JOB: 1
|
|
|
|
HEADLESS: true
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
2020-12-28 20:18:51 +01:00
|
|
|
- run: cat package.json | jq '.resolutions.webpack = "^5.11.1"' > package.json.tmp && mv package.json.tmp package.json
|
2020-11-01 04:37:28 +01:00
|
|
|
- run: cat package.json | jq '.resolutions.react = "^17.0.1"' > package.json.tmp && mv package.json.tmp package.json
|
|
|
|
- run: cat package.json | jq '.resolutions."react-dom" = "^17.0.1"' > package.json.tmp && mv package.json.tmp package.json
|
2020-07-30 01:19:32 +02:00
|
|
|
- run: yarn install --check-files
|
2020-11-01 04:37:28 +01:00
|
|
|
- run: yarn list webpack react react-dom
|
2021-01-01 18:39:39 +01:00
|
|
|
- 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
|
2020-07-30 01:19:32 +02:00
|
|
|
|
2020-01-27 21:07:31 +01:00
|
|
|
testFirefox:
|
|
|
|
name: Test Firefox (production)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
2020-01-28 05:48:52 +01:00
|
|
|
env:
|
|
|
|
HEADLESS: true
|
2020-05-15 22:13:37 +02:00
|
|
|
BROWSERNAME: 'firefox'
|
|
|
|
NEXT_TELEMETRY_DISABLED: 1
|
2020-01-27 21:07:31 +01:00
|
|
|
steps:
|
2020-07-23 06:06:50 +02:00
|
|
|
- uses: actions/cache@v2
|
2020-01-27 21:07:31 +01:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2020-07-23 06:06:50 +02:00
|
|
|
path: ./*
|
2020-01-27 21:07:31 +01:00
|
|
|
key: ${{ github.sha }}
|
2020-05-15 22:13:37 +02:00
|
|
|
- run: node run-tests.js test/integration/production/test/index.test.js
|
2020-01-27 21:07:31 +01:00
|
|
|
|
|
|
|
testSafari:
|
|
|
|
name: Test Safari (production)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
2020-01-28 05:48:52 +01:00
|
|
|
env:
|
|
|
|
BROWSERSTACK: true
|
2020-05-15 22:13:37 +02:00
|
|
|
BROWSERNAME: 'safari'
|
2020-02-20 19:35:28 +01:00
|
|
|
NEXT_TELEMETRY_DISABLED: 1
|
2020-01-28 20:04:00 +01:00
|
|
|
SKIP_LOCAL_SELENIUM_SERVER: true
|
2020-01-28 05:48:52 +01:00
|
|
|
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
|
|
|
|
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
|
2020-01-27 21:07:31 +01:00
|
|
|
steps:
|
2020-07-23 06:06:50 +02:00
|
|
|
- uses: actions/cache@v2
|
2020-01-27 21:07:31 +01:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2020-07-23 06:06:50 +02:00
|
|
|
path: ./*
|
2020-01-27 21:07:31 +01:00
|
|
|
key: ${{ github.sha }}
|
2020-05-15 22:13:37 +02:00
|
|
|
- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js test/integration/production/test/index.test.js'
|
2020-01-27 21:07:31 +01:00
|
|
|
|
2020-02-20 19:35:28 +01:00
|
|
|
testSafariOld:
|
|
|
|
name: Test Safari 10.1 (nav)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [build, testSafari]
|
|
|
|
env:
|
|
|
|
BROWSERSTACK: true
|
|
|
|
LEGACY_SAFARI: true
|
2020-05-15 22:13:37 +02:00
|
|
|
BROWSERNAME: 'safari'
|
2020-02-20 19:35:28 +01:00
|
|
|
NEXT_TELEMETRY_DISABLED: 1
|
|
|
|
SKIP_LOCAL_SELENIUM_SERVER: true
|
|
|
|
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
|
|
|
|
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
|
|
|
|
steps:
|
2020-07-23 06:06:50 +02:00
|
|
|
- uses: actions/cache@v2
|
2020-02-20 19:35:28 +01:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2020-07-23 06:06:50 +02:00
|
|
|
path: ./*
|
2020-02-20 19:35:28 +01:00
|
|
|
key: ${{ github.sha }}
|
2020-05-15 22:13:37 +02:00
|
|
|
- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js test/integration/production-nav/test/index.test.js'
|
2020-02-20 19:35:28 +01:00
|
|
|
|
2020-01-27 21:07:31 +01:00
|
|
|
publishRelease:
|
|
|
|
name: Potentially publish release
|
|
|
|
runs-on: ubuntu-latest
|
2020-01-28 05:48:52 +01:00
|
|
|
needs: [testsPass]
|
|
|
|
env:
|
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
2020-01-27 21:07:31 +01:00
|
|
|
steps:
|
2020-07-23 06:06:50 +02:00
|
|
|
- uses: actions/cache@v2
|
2020-01-28 05:48:52 +01:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2020-07-23 06:06:50 +02:00
|
|
|
path: ./*
|
2020-01-28 05:48:52 +01:00
|
|
|
key: ${{ github.sha }}
|
|
|
|
|
2020-01-27 21:07:31 +01:00
|
|
|
- run: ./publish-release.sh
|
2020-10-03 04:12:12 +02:00
|
|
|
|
|
|
|
prStats:
|
|
|
|
name: Release Stats
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [publishRelease]
|
|
|
|
steps:
|
2020-10-07 16:55:09 +02:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
id: restore-build
|
|
|
|
with:
|
|
|
|
path: ./*
|
|
|
|
key: ${{ github.sha }}
|
2020-10-03 04:12:12 +02:00
|
|
|
- run: ./release-stats.sh
|
|
|
|
- uses: ./.github/actions/next-stats-action
|
|
|
|
env:
|
|
|
|
PR_STATS_COMMENT_TOKEN: ${{ secrets.PR_STATS_COMMENT_TOKEN }}
|