Skip to content

Commit 62328e0

Browse files
Bart SchuurmansBartSchuurmans
authored andcommitted
Node.js >=10 is supported
- Document this in CONTRIBUTING.md - Run CI for Node.js 10/12/14/16 on Linux - Run CI for Node.js LTS on macOS - Don't share CircleCI cache between different architectures See warning at https://circleci.com/docs/2.0/caching/
1 parent bb06bbb commit 62328e0

File tree

4 files changed

+92
-32
lines changed

4 files changed

+92
-32
lines changed

.circleci/config.yml

Lines changed: 86 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,93 @@
1-
version: 2 # use CircleCI 2.0
2-
jobs: # a collection of steps
3-
build: # runs not using Workflows must have a `build` job as entry point
4-
working_directory: ~/git/bucklescript # directory where steps will run
5-
docker: # run the steps with Docker
6-
- image: circleci/node:dubnium # ...with this image as the primary container; this is where all `steps` will run
7-
steps: # a collection of executable commands
1+
version: '2.1'
2+
3+
executors:
4+
# TODO: we currently have python as a build dependency; it is accidentally included in circleci/node
5+
linux-node-v10:
6+
docker:
7+
- image: circleci/node:10
8+
linux-node-v12:
9+
docker:
10+
- image: circleci/node:12
11+
linux-node-v14:
12+
docker:
13+
- image: circleci/node:14
14+
linux-node-v16:
15+
docker:
16+
- image: circleci/node:16
17+
macos:
18+
macos:
19+
xcode: 12.5.0
20+
21+
orbs:
22+
node: circleci/node@4.5.0
23+
24+
jobs:
25+
build-test:
26+
parameters:
27+
executor:
28+
type: executor
29+
install-node:
30+
type: boolean
31+
default: false
32+
# defaults are the same as circleci/node orb:
33+
install-node-lts:
34+
type: boolean
35+
default: false
36+
install-node-version:
37+
type: string
38+
default: "node"
39+
install-npm-version:
40+
type: string
41+
default: "latest"
42+
executor: << parameters.executor >>
43+
environment:
44+
BS_TRAVIS_CI: 1
45+
NINJA_FORCE_REBUILD: 1
46+
OCAMLRUNPARAM: "b"
47+
steps:
848
- restore_cache: # try to restore .git folder from cache to speed up checkout
949
keys:
10-
- source-v1-{{ .Branch }}-{{ .Revision }}
11-
- source-v1-{{ .Branch }}-
12-
- source-v1-
13-
- checkout # special step to check out source code to working directory
14-
- run:
15-
name: "Pull git submodules"
16-
command: |
17-
git submodule sync
18-
git submodule update --init
50+
- source-v4-{{ arch }}-{{ .Branch }}-{{ .Revision }}
51+
- source-v4-{{ arch }}-{{ .Branch }}-
52+
- source-v4-{{ arch }}
53+
- checkout
54+
- run: git submodule sync
55+
- run: git submodule update --init
1956
- save_cache: # write .git folder to cache
20-
key: source-v1-{{ .Branch }}-{{ .Revision }}
57+
key: source-v4-{{ arch }}-{{ .Branch }}-{{ .Revision }}
2158
paths:
2259
- ".git"
23-
24-
- run:
25-
name: "Set environment variables"
26-
command: |
27-
echo 'export BS_TRAVIS_CI=1' >> $BASH_ENV
28-
echo 'export NINJA_FORCE_REBUILD=1' >> $BASH_ENV
29-
echo 'export OCAMLRUNPARAM="b"' >> $BASH_ENV
30-
- run:
31-
name: "Check environment variables"
32-
command: |
33-
echo BS_TRAVIS_CI ${BS_TRAVIS_CI}
3460

35-
- run: npm ci # `npm ci` is not available on node v8
61+
# install node and npm for executors where they are not preinstalled
62+
- when:
63+
condition: << parameters.install-node >>
64+
steps:
65+
- node/install:
66+
lts: << parameters.install-node-lts >>
67+
node-version: << parameters.install-node-version >>
68+
npm-version: << parameters.install-npm-version >>
69+
70+
- node/install-packages # npm ci
3671
- run: npm test
72+
73+
workflows:
74+
version: 2
75+
build-test-all: # workflow name
76+
jobs:
77+
- build-test:
78+
name: linux-node-v10
79+
executor: linux-node-v10
80+
- build-test:
81+
name: linux-node-v12
82+
executor: linux-node-v12
83+
- build-test:
84+
name: linux-node-v14
85+
executor: linux-node-v14
86+
- build-test:
87+
name: linux-node-v16
88+
executor: linux-node-v16
89+
- build-test:
90+
name: macos-node-lts
91+
executor: macos
92+
install-node: true
93+
install-node-lts: true

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Thanks for your help! Due to ReScript's nature, the contribution setup isn't all
44

55
## Prerequisites
66

7-
- [NodeJS](https://nodejs.org/)
7+
- [NodeJS](https://nodejs.org/) v10 or newer
88
- C compiler toolchain (you probably already have it installed)
99
- OS: Mac/Linux (ReScript works on Windows, but developing the repo using Windows isn't tested. Contribution welcome!)
1010

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
"mocha": "^7.2.0",
55
"nyc": "^15.0.0"
66
},
7+
"engines": {
8+
"node": ">=10"
9+
},
710
"bin": {
811
"bsb": "bsb",
912
"bsc": "bsc",
1013
"bsrefmt": "bsrefmt",
1114
"bstracing": "lib/bstracing",
12-
"rescript" : "rescript"
15+
"rescript": "rescript"
1316
},
1417
"scripts": {
1518
"test": "node scripts/ciTest.js -all",

0 commit comments

Comments
 (0)