2020-01-27 21:07:31 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [canary]
|
2021-08-12 12:22:50 +02:00
|
|
|
tags: [v*]
|
2020-01-27 21:07:31 +01:00
|
|
|
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 }}
|
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}}
|
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 }}
|
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
|
|
|
|
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-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 }}
|
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
|
|
|
|
# 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-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
|
|
|
|
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
|
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:
|
|
|
|
path: ./*
|
|
|
|
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
|
|
|
|
|
|
|
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:
|
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:
|
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
|
2021-01-25 22:11:27 +01:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2020-02-01 01:57:58 +01:00
|
|
|
|
2020-11-03 22:18:02 +01:00
|
|
|
- run: xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/6 -c 3
|
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
|
|
|
|
HEADLESS: true
|
|
|
|
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:
|
|
|
|
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
|
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-04-20 13:10:29 +02:00
|
|
|
path: ./*
|
|
|
|
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
|
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
|
|
|
|
|
2021-06-07 22:48:29 +02:00
|
|
|
testLegacyWebpack:
|
|
|
|
name: Webpack 4 (Basic, Production, Acceptance)
|
2020-07-30 01:19:32 +02:00
|
|
|
runs-on: ubuntu-latest
|
2021-04-20 13:10:29 +02:00
|
|
|
needs: build
|
2020-07-30 01:19:32 +02:00
|
|
|
env:
|
|
|
|
NEXT_TELEMETRY_DISABLED: 1
|
|
|
|
NEXT_TEST_JOB: 1
|
|
|
|
HEADLESS: true
|
2021-06-07 22:48:29 +02:00
|
|
|
NEXT_PRIVATE_TEST_WEBPACK4_MODE: 1
|
2020-07-30 01:19:32 +02: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
|
|
|
|
|
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-04-20 13:10:29 +02:00
|
|
|
path: ./*
|
|
|
|
key: ${{ github.sha }}
|
2021-01-15 04:29:57 +01:00
|
|
|
|
2021-06-07 22:48:29 +02:00
|
|
|
- run: xvfb-run node run-tests.js test/integration/{basic,fallback-modules,link-ref,production,async-modules,font-optimization,ssr-ctx}/test/index.test.js test/acceptance/*.test.js
|
2021-04-20 16:11:14 +02:00
|
|
|
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
|
2021-01-15 04:29:57 +01: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
|
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:
|
2020-07-23 06:06:50 +02:00
|
|
|
path: ./*
|
2020-01-27 21:07:31 +01:00
|
|
|
key: ${{ github.sha }}
|
2021-06-11 22:28:42 +02:00
|
|
|
- run: 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
|
|
|
|
|
|
|
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:
|
2020-07-23 06:06:50 +02:00
|
|
|
path: ./*
|
2020-01-27 21:07:31 +01:00
|
|
|
key: ${{ github.sha }}
|
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:
|
2020-07-23 06:06:50 +02:00
|
|
|
path: ./*
|
2020-02-20 19:35:28 +01:00
|
|
|
key: ${{ github.sha }}
|
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-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-08-12 12:22:50 +02:00
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
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:
|
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
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:
|
2020-07-23 06:06:50 +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:
|
|
|
|
path: ./*
|
|
|
|
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
|
|
|
|
- os: windows-latest
|
|
|
|
target: x86_64-pc-windows-msvc
|
|
|
|
- os: macos-latest
|
|
|
|
target: x86_64-apple-darwin
|
|
|
|
- os: macos-latest
|
|
|
|
target: aarch64-apple-darwin
|
|
|
|
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
|
|
|
|
toolchain: nightly-2021-03-25
|
|
|
|
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-08-15 20:44:28 +02:00
|
|
|
key: next-swc-nightly-2021-03-25-${{ matrix.target }}-${{ hashFiles('.github/workflows/build_test_deploy.yml', 'packages/next/build/swc/**') }}
|
|
|
|
- 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
|
|
|
|
uses: actions/upload-artifact@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:
|
|
|
|
name: next-swc-binaries
|
|
|
|
path: packages/next/native/next-swc.*.node
|
|
|
|
- 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:
|
|
|
|
toolchain: nightly-2021-03-25
|
|
|
|
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' }}
|