How to run Node.js matrix on different OS?


#1

e.g.

Each version of Node.js 6 / 8 / 10 run on Linux / macOS / Windows.

That means run 9 task each time. How can I do this?


#2

This is not clearly documented at the moment, but you can use os as a build matrix axis. In other words, the following works:

language: node_js
node_js:
  - 6
  - 8
  - 10
os:
  - linux
  - osx
  - windows

#3

@BanzaiMan

And if I want to try multiple linux version?

What’s more, the environment script will be different between each platform. How to configure them in that way? e.g. Linux needs addons.

Something like that

  install:
    - export CXX="g++-4.8" CXX="gcc-4.8"
    - npm install
  addons:
    apt:
      sources:
        - ubuntu-toolchain-r-test
      packages:
        - gcc-4.8
        - g++-4.8
        - clang

#4

Hi @BanzaiMan,

My needs is that, test each Node.js version on each platform. And each platform have to run it’s own script.

What’s more, I need to install Java for each platform to start up a server-end program.