Search code examples
node.jsappveyor

Appveyor test for monorepo where parts of the project use different NodeJS versions


I am working on a mono-repo project that has this simplified structure:

  • js_app_1
  • js_app_2
  • python_apps

First js_app_1 can use NodeJS up to a v10, because of outdated plugins, but the js_app_2 is completely new, with bleeding edge plugins. At this moment, we are limited by the Appveyor in testing everything on NodeJS v10, but I would like to make a configuration where js_app_1 will be tested only with nodeJS v10 and js_app_2 with always the latest one.

Is there a way to achieve this in Appveyor?


Solution

  • You can switch between Node versions with Install-Product node [version] [bitness] PowerShell command, for example Install-Product node 10 for the latest 10.x and Install-Product node '' for the always latest one (currently 14.x).

    You can either build/test both JS apps sequentially in a single build job, i.e. "cd into js_app_1, switch Node version, build/test then cd into js_app_2, switch Node version, build/test" or configure multi-job "matrix" build for each JS app and python apps: https://www.appveyor.com/docs/build-configuration/#build-matrix