From 8b6f7ed027ca87d7c86cabf031cd1eb698272d60 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 15 Apr 2020 11:58:02 -0700 Subject: [PATCH] fix: update docs and metadata to require Node.js v12.16.1 or higher We acquired a dependency on at least 12.11 (see #837) that we don't understand enough to relax, and we're only testing CI on 12.16.1 (the current LTS). So we're declaring that we require Node 12.16.1 or higher. This updates the top-level package.json's `engines:` property, so that `yarn` will complain immediately if you use an old Node. It also updates a SwingSet unit test to check for the new version, as a backup. closes #937 refs #837 (makes it obsolete) closes #35 --- .github/workflows/ag-solo-xs.yml | 3 +++ .github/workflows/integration.yml | 3 +++ .github/workflows/test-all-packages.yml | 3 +++ .github/workflows/test-all-packages.yml.use-cache | 3 +++ README.md | 2 +- package.json | 3 +++ packages/SwingSet/test/test-node-version.js | 10 +++++++++- 7 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ag-solo-xs.yml b/.github/workflows/ag-solo-xs.yml index 786410c3e4b1..e7fd8f70f9b9 100644 --- a/.github/workflows/ag-solo-xs.yml +++ b/.github/workflows/ag-solo-xs.yml @@ -16,6 +16,9 @@ jobs: steps: - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: '12.16.1' - name: cache node modules uses: actions/cache@v1 with: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4f43978f77ab..85c76602b31a 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -24,6 +24,9 @@ jobs: # restore-keys: | # ${{ runner.os }}-go- + - uses: actions/setup-node@v1 + with: + node-version: '12.16.1' # 'yarn install' must be done at the top level, to build all the # cross-package symlinks - run: yarn install diff --git a/.github/workflows/test-all-packages.yml b/.github/workflows/test-all-packages.yml index 5de6a3ad491f..7527c121835e 100644 --- a/.github/workflows/test-all-packages.yml +++ b/.github/workflows/test-all-packages.yml @@ -13,6 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: '12.16.1' # FIXME: Reenable after 2020-04-01 when Github cache doesn't take forever. #- name: cache node modules diff --git a/.github/workflows/test-all-packages.yml.use-cache b/.github/workflows/test-all-packages.yml.use-cache index 56b41494a7f4..778e60079155 100644 --- a/.github/workflows/test-all-packages.yml.use-cache +++ b/.github/workflows/test-all-packages.yml.use-cache @@ -13,6 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: '12.16.1' - name: cache node modules uses: actions/cache@v1 diff --git a/README.md b/README.md index 5a69b36d9b2c..b7cbaa697955 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ But if you are improving the platform itself, this is the repository to use. ## Prerequisites * Git -* Node.js (version 11 or higher) +* Node.js (version 12.16.1 or higher) * Yarn (`npm install -g yarn`) You don't need Golang if you just want to test contracts and run the diff --git a/package.json b/package.json index 3aee8f47b3a3..97d0e0bdfe12 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,9 @@ "lerna": "^3.20.2", "prettier": "^1.18.2" }, + "engines": { + "node": ">=12.16.1" + }, "scripts": { "OFF-clean": "yarn workspaces run clean", "check-dependencies": "node ./scripts/check-mismatched-dependencies.js", diff --git a/packages/SwingSet/test/test-node-version.js b/packages/SwingSet/test/test-node-version.js index 56189121ea68..42223971ba97 100644 --- a/packages/SwingSet/test/test-node-version.js +++ b/packages/SwingSet/test/test-node-version.js @@ -3,10 +3,18 @@ import semver from 'semver'; import { test } from 'tape-promise/tape'; -test('Node version', t => { +test('Node version for IO queue priority', t => { t.true( semver.satisfies(process.version, '>=11.0'), 'we need Node 11 where the IO queue is higher priority than the Promise queue', ); t.end(); }); + +test('Node version', t => { + t.true( + semver.satisfies(process.version, '>=12.16.1'), + 'we only test against Node 12.16.1 (LTS)', + ); + t.end(); +});