How to use different build matrix on different branches?

WC Leung's Avatar

WC Leung

29 Jul, 2017 07:55 AM

Now I'm using a typical node.js build matrix with 3 different node versions. Since the builds are slow (frankly much slower than Travis CI, I want to build for only 1 node version except for the master branch (which continues to build for all 3 versions). How should I do this? (Note: The build config is copied below. Except for node versions, all build configs should be shared among all configurations.)

# Test against the latest version of this Node.js version
environment:
  matrix:
    - nodejs_version: "5"
    - nodejs_version: "6"
    - nodejs_version: "8"

# Install scripts. (runs after repo cloning)
install:
  # Get the latest stable version of Node.js or io.js
  - ps: Install-Product node $env:nodejs_version
  # install modules
  - yarn install

# Post-install test scripts.
test_script:
  # Output useful info for debugging.
  - node --version
  - yarn --version
  # run tests
  - yarn test

# Don't actually build.
build: off

# Cache
cache:
  - "%LOCALAPPDATA%\\Yarn"
  1. 1 Posted by Ilya Finkelshte... on 31 Jul, 2017 10:36 PM

    Ilya Finkelshteyn's Avatar

    You can use conditional build configuration and have matrix only for master.
    For right now it will add some duplication to your YAML files, but after this issue closed (will be soon), you will be able to make your YAML compact again.

    P.S. Regarding performance, we run Windows builds, so node.js engine is different. We will soon provide Linux builds, and after that speed comparison will be valid.

  2. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:18 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

18 Jun, 2025 08:45 PM
18 Jun, 2025 04:23 PM
13 Jun, 2025 04:36 PM
13 Jun, 2025 04:27 PM
13 Jun, 2025 07:20 AM

 

10 Jun, 2025 01:56 AM
09 Jun, 2025 07:11 PM
04 Jun, 2025 04:08 PM
27 May, 2025 05:48 PM
27 May, 2025 06:37 AM
27 May, 2025 06:31 AM