2020-01-27 21:07:31 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [canary]
|
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize]
|
|
|
|
|
|
|
|
name: Build, test, and deploy
|
|
|
|
|
|
|
|
jobs:
|
2021-08-14 20:34:40 +02:00
|
|
|
check-examples:
|
|
|
|
name: Check examples
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install moreutils
|
|
|
|
run: sudo apt install moreutils
|
|
|
|
- name: Check examples
|
|
|
|
run: ./scripts/check-examples.sh
|
|
|
|
|
2020-01-27 21:07:31 +01:00
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2020-01-28 05:48:52 +01:00
|
|
|
env:
|
|
|
|
NEXT_TELEMETRY_DISABLED: 1
|
2021-01-11 20:24:17 +01:00
|
|
|
outputs:
|
|
|
|
docsChange: ${{ steps.docs-change.outputs.DOCS_CHANGE }}
|
2021-09-16 23:36:02 +02:00
|
|
|
isRelease: ${{ steps.check-release.outputs.IS_RELEASE }}
|
2020-01-27 21:07:31 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-01-26 21:34:30 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 25
|
|
|
|
|
2021-08-18 22:29:15 +02:00
|
|
|
# https://github.com/actions/virtual-environments/issues/1187
|
|
|
|
- name: tune linux network
|
|
|
|
run: sudo ethtool -K eth0 tx off rx off
|
|
|
|
|
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
|
2021-01-11 20:24:17 +01:00
|
|
|
- name: Check docs only change
|
2021-01-25 22:11:27 +01:00
|
|
|
run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
|
2021-01-11 20:24:17 +01:00
|
|
|
id: docs-change
|
|
|
|
- run: echo ${{steps.docs-change.outputs.DOCS_CHANGE}}
|
2021-09-16 23:36:02 +02:00
|
|
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
|
|
- run: git describe
|
|
|
|
- id: check-release
|
|
|
|
run: |
|
|
|
|
if [[ $(git describe --exact-match 2> /dev/null || :) = v* ]];
|
|
|
|
then
|
|
|
|
echo "::set-output name=IS_RELEASE::true"
|
|
|
|
else
|
|
|
|
echo "::set-output name=IS_RELEASE::false"
|
|
|
|
fi
|
2020-07-23 06:06:50 +02:00
|
|
|
- uses: actions/cache@v2
|
2020-01-27 21:07:31 +01:00
|
|
|
id: cache-build
|
|
|
|
with:
|
2021-09-21 22:01:08 +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:
|
2021-09-21 22:01:08 +02:00
|
|
|
path: ./*
|
2020-01-27 21:07:31 +01:00
|
|
|
key: ${{ github.sha }}
|
2021-08-11 11:17:57 +02:00
|
|
|
- run: ./scripts/check-manifests.js
|
2020-01-27 21:07:31 +01:00
|
|
|
- run: yarn lint
|
|
|
|
|
2020-04-07 15:42:16 +02:00
|
|
|
checkPrecompiled:
|
|
|
|
name: Check Pre-compiled
|
|
|
|
runs-on: ubuntu-latest
|
2021-08-12 12:22:50 +02:00
|
|
|
needs: [build, build-native]
|
2020-04-07 15:42:16 +02:00
|
|
|
env:
|
|
|
|
NEXT_TELEMETRY_DISABLED: 1
|
|
|
|
steps:
|
2021-08-18 22:29:15 +02:00
|
|
|
# https://github.com/actions/virtual-environments/issues/1187
|
|
|
|
- name: tune linux network
|
2021-09-21 19:17:16 +02:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2021-08-18 22:29:15 +02:00
|
|
|
run: sudo ethtool -K eth0 tx off rx off
|
|
|
|
|
2021-09-21 22:29:44 +02:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
|
|
|
|
- run: mv .git .git-bak
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
|
2020-07-23 06:06:50 +02:00
|
|
|
- uses: actions/cache@v2
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-04-07 15:42:16 +02:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2021-09-21 22:29:44 +02:00
|
|
|
path: ./*
|
2020-04-07 15:42:16 +02:00
|
|
|
key: ${{ github.sha }}
|
2021-09-21 19:17:16 +02:00
|
|
|
|
2021-09-21 22:29:44 +02:00
|
|
|
- run: rm -rf .git && mv .git-bak .git
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
|
2021-08-12 12:22:50 +02:00
|
|
|
- uses: actions/download-artifact@v2
|
2021-08-14 03:44:51 +02:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2021-08-12 12:22:50 +02:00
|
|
|
with:
|
|
|
|
name: next-swc-binaries
|
|
|
|
path: packages/next/build/swc/dist
|
2021-09-21 19:17:16 +02:00
|
|
|
|
2021-08-12 12:22:50 +02:00
|
|
|
# Only check linux build for now, mac builds can sometimes be different even with the same code
|
|
|
|
- run: |
|
|
|
|
mv ./packages/next/build/swc/dist/next-swc.linux-x64-gnu.node \
|
|
|
|
./packages/next/native/next-swc.linux-x64-gnu.node
|
2021-08-14 03:44:51 +02:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2021-09-21 19:17:16 +02:00
|
|
|
|
2021-07-01 13:41:27 +02:00
|
|
|
- run: ./scripts/check-pre-compiled.sh
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-04-07 15:42:16 +02:00
|
|
|
|
2021-09-21 19:17:16 +02:00
|
|
|
- uses: EndBug/add-and-commit@v7
|
|
|
|
if: ${{ failure() }}
|
|
|
|
with:
|
|
|
|
add: 'packages/next/compiled packages/next/bundles --force'
|
|
|
|
message: '⚙ Update compiled files'
|
|
|
|
|
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
|
|
|
|
steps:
|
|
|
|
- uses: actions/cache@v2
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-11-10 18:25:50 +01:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2021-09-21 22:01:08 +02:00
|
|
|
path: ./*
|
2020-11-10 18:25:50 +01:00
|
|
|
key: ${{ github.sha }}
|
|
|
|
|
2021-08-24 14:52:45 +02:00
|
|
|
- run: node run-tests.js --type unit
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-11-10 18:25:50 +01:00
|
|
|
|
2021-09-13 14:36:25 +02:00
|
|
|
testDev:
|
|
|
|
name: Test Development
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
env:
|
|
|
|
NEXT_TELEMETRY_DISABLED: 1
|
|
|
|
NEXT_TEST_JOB: 1
|
|
|
|
steps:
|
|
|
|
- run: echo ${{needs.build.outputs.docsChange}}
|
|
|
|
|
|
|
|
# https://github.com/actions/virtual-environments/issues/1187
|
|
|
|
- name: tune linux network
|
|
|
|
run: sudo ethtool -K eth0 tx off rx off
|
|
|
|
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
id: restore-build
|
|
|
|
with:
|
2021-09-21 22:01:08 +02:00
|
|
|
path: ./*
|
2021-09-13 14:36:25 +02:00
|
|
|
key: ${{ github.sha }}
|
|
|
|
|
|
|
|
- run: npm i -g playwright-chromium@1.14.1 && npx playwright install-deps
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
|
|
|
|
# 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
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
|
2021-09-21 19:04:23 +02:00
|
|
|
- run: node run-tests.js --type development
|
2021-09-13 14:36:25 +02:00
|
|
|
name: Run test/development
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
|
|
|
|
- run: NEXT_TEST_MODE=dev node run-tests.js --type e2e
|
|
|
|
name: Run test/e2e (dev)
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
|
|
|
|
testProd:
|
|
|
|
name: Test Production
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
|
|
|
env:
|
|
|
|
NEXT_TELEMETRY_DISABLED: 1
|
|
|
|
NEXT_TEST_JOB: 1
|
|
|
|
steps:
|
|
|
|
- run: echo ${{needs.build.outputs.docsChange}}
|
|
|
|
|
|
|
|
# https://github.com/actions/virtual-environments/issues/1187
|
|
|
|
- name: tune linux network
|
|
|
|
run: sudo ethtool -K eth0 tx off rx off
|
|
|
|
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
id: restore-build
|
|
|
|
with:
|
2021-09-21 22:01:08 +02:00
|
|
|
path: ./*
|
2021-09-13 14:36:25 +02:00
|
|
|
key: ${{ github.sha }}
|
|
|
|
|
|
|
|
- run: npm i -g playwright-chromium@1.14.1 && npx playwright install-deps
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
|
|
|
|
# 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
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
|
|
|
|
- run: node run-tests.js --type production
|
|
|
|
name: Run test/production
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
|
|
|
|
- run: NEXT_TEST_MODE=start node run-tests.js --type e2e
|
|
|
|
name: Run test/e2e (production)
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
|
2020-11-10 18:25:50 +01:00
|
|
|
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
|
2021-09-28 17:15:04 +02:00
|
|
|
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
|
2020-01-27 21:07:31 +01:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
group: [1, 2, 3, 4, 5, 6]
|
|
|
|
steps:
|
2021-01-11 20:24:17 +01:00
|
|
|
- run: echo ${{needs.build.outputs.docsChange}}
|
2021-08-18 22:29:15 +02:00
|
|
|
|
|
|
|
# https://github.com/actions/virtual-environments/issues/1187
|
|
|
|
- name: tune linux network
|
|
|
|
run: sudo ethtool -K eth0 tx off rx off
|
|
|
|
|
2020-07-23 06:06:50 +02:00
|
|
|
- uses: actions/cache@v2
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-01-27 21:07:31 +01:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2021-09-21 22:01:08 +02:00
|
|
|
path: ./*
|
2020-01-27 21:07:31 +01:00
|
|
|
key: ${{ github.sha }}
|
2020-02-01 01:57:58 +01:00
|
|
|
|
2021-09-13 14:36:25 +02:00
|
|
|
- run: npm i -g playwright-chromium@1.14.1 && npx playwright install-deps
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
|
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
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-02-01 01:57:58 +01:00
|
|
|
|
2021-09-13 14:36:25 +02:00
|
|
|
- run: xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/6
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
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
|
|
|
|
TEST_ELECTRON: 1
|
|
|
|
steps:
|
|
|
|
- uses: actions/cache@v2
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-11-05 21:45:21 +01:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2021-09-21 22:01:08 +02:00
|
|
|
path: ./*
|
2020-11-05 21:45:21 +01:00
|
|
|
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
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-11-05 21:45:21 +01:00
|
|
|
|
2021-04-15 17:21:32 +02:00
|
|
|
- run: cd test/integration/with-electron/app && yarn
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-11-05 21:45:21 +01:00
|
|
|
|
|
|
|
- run: xvfb-run node run-tests.js test/integration/with-electron/test/index.test.js
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-11-05 21:45:21 +01:00
|
|
|
|
2020-08-17 19:39:57 +02:00
|
|
|
testYarnPnP:
|
|
|
|
runs-on: ubuntu-latest
|
2021-04-20 13:10:29 +02:00
|
|
|
needs: build
|
2020-08-17 19:39:57 +02:00
|
|
|
env:
|
|
|
|
NODE_OPTIONS: '--unhandled-rejections=strict'
|
2021-01-04 16:30:46 +01:00
|
|
|
YARN_COMPRESSION_LEVEL: '0'
|
2020-08-17 19:39:57 +02:00
|
|
|
steps:
|
2021-04-20 13:10:29 +02:00
|
|
|
- uses: actions/cache@v2
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
id: restore-build
|
2021-01-26 21:34:30 +01:00
|
|
|
with:
|
2021-09-21 22:01:08 +02:00
|
|
|
path: ./*
|
2021-04-20 13:10:29 +02:00
|
|
|
key: ${{ github.sha }}
|
2020-08-17 19:39:57 +02:00
|
|
|
|
2021-07-01 13:41:27 +02:00
|
|
|
- run: bash ./scripts/test-pnp.sh
|
2021-04-20 13:10:29 +02:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-08-17 19:39:57 +02:00
|
|
|
|
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
|
2021-09-13 14:36:25 +02:00
|
|
|
needs:
|
|
|
|
[
|
|
|
|
lint,
|
2021-09-21 19:17:16 +02:00
|
|
|
check-examples,
|
|
|
|
test-native,
|
2021-09-13 14:36:25 +02:00
|
|
|
checkPrecompiled,
|
|
|
|
testIntegration,
|
|
|
|
testUnit,
|
|
|
|
testYarnPnP,
|
|
|
|
testDev,
|
|
|
|
testProd,
|
|
|
|
]
|
2020-01-27 21:07:31 +01:00
|
|
|
steps:
|
|
|
|
- run: exit 0
|
|
|
|
|
|
|
|
testFirefox:
|
|
|
|
name: Test Firefox (production)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
2020-01-28 05:48:52 +01:00
|
|
|
env:
|
2021-06-11 21:38:51 +02:00
|
|
|
BROWSER_NAME: 'firefox'
|
2020-05-15 22:13:37 +02:00
|
|
|
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
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-01-27 21:07:31 +01:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2021-09-21 22:01:08 +02:00
|
|
|
path: ./*
|
2020-01-27 21:07:31 +01:00
|
|
|
key: ${{ github.sha }}
|
2021-09-13 14:36:25 +02:00
|
|
|
- run: npx playwright install-deps && npx playwright install firefox
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
- run: node run-tests.js test/integration/production/test/index.test.js
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
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
|
2021-06-11 21:38:51 +02:00
|
|
|
BROWSER_NAME: '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:
|
2021-08-18 22:29:15 +02:00
|
|
|
# https://github.com/actions/virtual-environments/issues/1187
|
|
|
|
- name: tune linux network
|
|
|
|
run: sudo ethtool -K eth0 tx off rx off
|
|
|
|
|
2020-07-23 06:06:50 +02:00
|
|
|
- uses: actions/cache@v2
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-01-27 21:07:31 +01:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2021-09-21 22:01:08 +02:00
|
|
|
path: ./*
|
2020-01-27 21:07:31 +01:00
|
|
|
key: ${{ github.sha }}
|
2021-09-13 14:36:25 +02:00
|
|
|
|
|
|
|
# TODO: use macos runner so that we can use playwright to test against
|
|
|
|
# PRs instead of only running on canary?
|
2021-09-13 17:56:07 +02:00
|
|
|
- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || npm i -g browserstack-local@1.4.0'
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
|
2021-06-11 22:28:42 +02:00
|
|
|
- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js -c 1 test/integration/production/test/index.test.js'
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
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
|
2021-06-11 21:38:51 +02:00
|
|
|
BROWSER_NAME: '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:
|
2021-08-18 22:29:15 +02:00
|
|
|
# https://github.com/actions/virtual-environments/issues/1187
|
|
|
|
- name: tune linux network
|
|
|
|
run: sudo ethtool -K eth0 tx off rx off
|
|
|
|
|
2020-07-23 06:06:50 +02:00
|
|
|
- uses: actions/cache@v2
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-02-20 19:35:28 +01:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2021-09-21 22:01:08 +02:00
|
|
|
path: ./*
|
2020-02-20 19:35:28 +01:00
|
|
|
key: ${{ github.sha }}
|
2021-09-13 14:36:25 +02:00
|
|
|
|
|
|
|
- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || npm i -g browserstack-local@1.4.0'
|
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
|
|
|
|
|
|
|
- run: '[[ -z "$BROWSERSTACK_ACCESS_KEY" ]] && echo "Skipping for PR" || node run-tests.js test/integration/production-nav/test/index.test.js'
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-02-20 19:35:28 +01:00
|
|
|
|
2020-01-27 21:07:31 +01:00
|
|
|
publishRelease:
|
2021-09-16 23:36:02 +02:00
|
|
|
if: ${{ needs.build.outputs.isRelease == 'true' }}
|
2020-01-27 21:07:31 +01:00
|
|
|
name: Potentially publish release
|
|
|
|
runs-on: ubuntu-latest
|
2021-08-12 12:22:50 +02:00
|
|
|
needs: [build, build-native]
|
2020-01-28 05:48:52 +01:00
|
|
|
env:
|
2021-09-03 18:58:11 +02:00
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
|
2020-01-27 21:07:31 +01:00
|
|
|
steps:
|
2021-08-18 22:29:15 +02:00
|
|
|
# https://github.com/actions/virtual-environments/issues/1187
|
|
|
|
- name: tune linux network
|
|
|
|
run: sudo ethtool -K eth0 tx off rx off
|
|
|
|
|
2020-07-23 06:06:50 +02:00
|
|
|
- uses: actions/cache@v2
|
2020-01-28 05:48:52 +01:00
|
|
|
id: restore-build
|
|
|
|
with:
|
2021-09-21 22:01:08 +02:00
|
|
|
path: ./*
|
2020-01-28 05:48:52 +01:00
|
|
|
key: ${{ github.sha }}
|
2021-08-12 12:22:50 +02:00
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
name: next-swc-binaries
|
|
|
|
path: packages/next/build/swc/dist
|
2021-08-12 19:55:07 +02:00
|
|
|
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
2021-08-12 12:22:50 +02:00
|
|
|
- run: ./scripts/publish-native.js $GITHUB_REF
|
2021-07-01 13:41:27 +02:00
|
|
|
- run: ./scripts/publish-release.sh
|
2020-10-03 04:12:12 +02:00
|
|
|
|
2021-08-10 23:24:45 +02:00
|
|
|
releaseStats:
|
2020-10-03 04:12:12 +02:00
|
|
|
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:
|
2021-09-21 22:01:08 +02:00
|
|
|
path: ./*
|
2020-10-07 16:55:09 +02:00
|
|
|
key: ${{ github.sha }}
|
2021-07-01 13:41:27 +02:00
|
|
|
- run: ./scripts/release-stats.sh
|
2020-10-03 04:12:12 +02:00
|
|
|
- uses: ./.github/actions/next-stats-action
|
|
|
|
env:
|
|
|
|
PR_STATS_COMMENT_TOKEN: ${{ secrets.PR_STATS_COMMENT_TOKEN }}
|
2021-08-12 12:22:50 +02:00
|
|
|
|
|
|
|
build-native:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-18.04, macos-latest, windows-latest]
|
|
|
|
description: [default]
|
|
|
|
include:
|
|
|
|
- os: ubuntu-18.04
|
|
|
|
target: x86_64-unknown-linux-gnu
|
2021-09-14 01:40:06 +02:00
|
|
|
name: linux-x64-gnu
|
2021-08-12 12:22:50 +02:00
|
|
|
- os: windows-latest
|
|
|
|
target: x86_64-pc-windows-msvc
|
2021-09-14 01:40:06 +02:00
|
|
|
name: win32-x64-msvc
|
2021-08-12 12:22:50 +02:00
|
|
|
- os: macos-latest
|
|
|
|
target: x86_64-apple-darwin
|
2021-09-14 01:40:06 +02:00
|
|
|
name: darwin-x64
|
2021-08-12 12:22:50 +02:00
|
|
|
- os: macos-latest
|
|
|
|
target: aarch64-apple-darwin
|
2021-09-14 01:40:06 +02:00
|
|
|
name: darwin-arm64
|
2021-08-12 12:22:50 +02:00
|
|
|
description: m1
|
|
|
|
|
|
|
|
name: next-swc - ${{ matrix.os }} - ${{ matrix.target }} - node@14
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
|
|
|
|
steps:
|
2021-08-18 22:29:15 +02:00
|
|
|
# https://github.com/actions/virtual-environments/issues/1187
|
|
|
|
- name: tune linux network
|
|
|
|
run: sudo ethtool -K eth0 tx off rx off
|
|
|
|
if: ${{ matrix.os == 'ubuntu-18.04' }}
|
|
|
|
- name: tune windows network
|
|
|
|
run: Disable-NetAdapterChecksumOffload -Name * -TcpIPv4 -UdpIPv4 -TcpIPv6 -UdpIPv6
|
|
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
|
|
|
- name: tune mac network
|
|
|
|
run: sudo sysctl -w net.link.generic.system.hwcksum_tx=0 && sudo sysctl -w net.link.generic.system.hwcksum_rx=0
|
|
|
|
if: ${{ matrix.os == 'macos-latest' }}
|
|
|
|
|
2021-08-12 12:22:50 +02:00
|
|
|
- uses: actions/checkout@v2
|
2021-08-14 16:28:42 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 25
|
|
|
|
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
|
|
|
|
id: docs-change
|
2021-08-12 12:22:50 +02:00
|
|
|
- name: Setup node
|
|
|
|
uses: actions/setup-node@v2
|
2021-08-14 16:28:42 +02:00
|
|
|
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
|
2021-08-12 12:22:50 +02:00
|
|
|
with:
|
|
|
|
node-version: 14
|
|
|
|
check-latest: true
|
|
|
|
- name: Install
|
|
|
|
uses: actions-rs/toolchain@v1
|
2021-08-14 16:28:42 +02:00
|
|
|
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
|
2021-08-12 12:22:50 +02:00
|
|
|
with:
|
|
|
|
profile: minimal
|
2021-09-15 09:24:31 +02:00
|
|
|
toolchain: nightly-2021-08-12
|
2021-08-12 12:22:50 +02:00
|
|
|
target: ${{ matrix.target }}
|
|
|
|
- name: Cache cargo registry
|
|
|
|
uses: actions/cache@v1
|
2021-08-14 16:28:42 +02:00
|
|
|
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
|
2021-08-12 12:22:50 +02:00
|
|
|
with:
|
|
|
|
path: ~/.cargo/registry
|
|
|
|
key: stable-${{ matrix.os }}-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Cache cargo index
|
|
|
|
uses: actions/cache@v1
|
2021-08-14 16:28:42 +02:00
|
|
|
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
|
2021-08-12 12:22:50 +02:00
|
|
|
with:
|
|
|
|
path: ~/.cargo/git
|
|
|
|
key: stable-${{ matrix.os }}-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
- name: Cache native binary
|
|
|
|
id: binary-cache
|
|
|
|
uses: actions/cache@v2
|
2021-08-14 16:28:42 +02:00
|
|
|
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
|
2021-08-12 12:22:50 +02:00
|
|
|
with:
|
|
|
|
path: packages/next/native/next-swc.*.node
|
2021-09-15 09:24:31 +02:00
|
|
|
key: next-swc-nightly-2021-08-12-${{ matrix.target }}-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }}
|
2021-08-15 20:44:28 +02:00
|
|
|
- name: Cross build aarch64 setup
|
|
|
|
if: ${{ matrix.target == 'aarch64-apple-darwin' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
|
|
|
|
run: |
|
|
|
|
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
|
|
|
|
export CC=$(xcrun -f clang);
|
|
|
|
export CXX=$(xcrun -f clang++);
|
|
|
|
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
|
|
|
|
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
|
2021-08-12 12:22:50 +02:00
|
|
|
- name: 'Build'
|
2021-08-14 16:28:42 +02:00
|
|
|
if: ${{ steps.binary-cache.outputs.cache-hit != 'true' && steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
|
2021-08-12 12:22:50 +02:00
|
|
|
run: yarn build-native --target ${{ matrix.target }}
|
|
|
|
env:
|
|
|
|
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
|
|
|
working-directory: packages/next
|
|
|
|
- name: Upload artifact
|
2021-09-07 10:36:10 +02:00
|
|
|
uses: actions/upload-artifact@v2.2.4
|
2021-08-12 12:22:50 +02:00
|
|
|
with:
|
|
|
|
name: next-swc-binaries
|
2021-09-14 01:40:06 +02:00
|
|
|
path: packages/next/native/next-swc.${{ matrix.name }}.node
|
2021-08-12 12:22:50 +02:00
|
|
|
- name: Clear the cargo caches
|
2021-08-14 16:28:42 +02:00
|
|
|
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
|
2021-08-12 12:22:50 +02:00
|
|
|
run: |
|
|
|
|
cargo install cargo-cache --no-default-features --features ci-autoclean
|
|
|
|
cargo-cache
|
|
|
|
|
|
|
|
test-native:
|
|
|
|
name: Unit Test Native Code
|
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-08-14 16:28:42 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 25
|
|
|
|
- run: echo ::set-output name=DOCS_CHANGE::$(node skip-docs-change.js echo 'not-docs-only-change')
|
|
|
|
id: docs-change
|
2021-08-12 12:22:50 +02:00
|
|
|
- name: Install
|
2021-08-14 16:28:42 +02:00
|
|
|
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
|
2021-08-12 12:22:50 +02:00
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-09-15 09:24:31 +02:00
|
|
|
toolchain: nightly-2021-08-12
|
2021-08-12 12:22:50 +02:00
|
|
|
profile: minimal
|
|
|
|
- run: cd packages/next/build/swc && cargo test
|
2021-08-14 16:28:42 +02:00
|
|
|
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
|