Build matrix overrides

Hey all.
I'm trying to override test scripts in a build matrix. I have a 3x2 matrix, but only need half to be run at any given time.

image: Ubuntu

platform:
  - electron
  - linux
  - simulator

configuration:
  - production
  - qa

environment:
  nodejs_version: 12.20.2
  DEPENDENCY: 0
  APP_VERSION: 1
  BUILD_POSTFIX: -nightly

version: '${APP_VERSION}-{build}'

test_script:
  - echo "Default should always be overridden"

for:
  -
    matrix:
      only:
        - configuration: qa
      skip_tags: true
      environment:
        BUILD_POSTFIX: -qa
  -
    matrix:
      only:
        - platform: simulator
    test_script:
      - ./run_sim_tests.sh
  -
    matrix:
      only:
        - platform: linux
    test_script:
      - ./run_linux_tests.sh
  -
    matrix:
      only:
        - configuration: production
      environment:
        BUILD_POSTFIX: -prod

The intention is that the test scripts get overridden for everything linux or simulator in both QA and prod. However the values seem to be ignored. How can I properly merge these values? The documentation explains that matrix dimensions aren't valid in a for construct, but I'm not sure what else to override on.

Setup as an environment variable?
Thanks!

  1. A quick way to summarize: I'm trying to add environment to each matrix COLUMN and then have them merged into the matrix element.

  2. Thanks for the reply!
    I see, you can't select a column or row of the matrix, you must select a cell.

    I suggest adding such selections as a feature: I have some configuration I'd like to replicate for all jobs of a platform, some common configuration, and some cell configuration. It would make generating configuration much easier.

    For now I'll move it into a bash script.

  3. Thanks for the update! Honestly, sometimes script is the best way.

  4. Feodor Fitsner closed this discussion on 18 Jun, 2021 09:03 PM.

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