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!
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
1 Posted by ahigginscassidy on 16 Apr, 2021 04:08 PM
A quick way to summarize: I'm trying to add environment to each matrix COLUMN and then have them merged into the matrix element.
Support Staff 2 Posted by Feodor Fitsner on 16 Apr, 2021 06:00 PM
I've got the following solution: https://gist.github.com/FeodorFitsner/79194d15e202160e2e2f40d77b176...
Example build: https://ci.appveyor.com/project/FeodorFitsner/simple-console/builds...
3 Posted by ahigginscassidy on 16 Apr, 2021 06:44 PM
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.
Support Staff 4 Posted by Feodor Fitsner on 18 Apr, 2021 08:10 PM
Thanks for the update! Honestly, sometimes script is the best way.
Feodor Fitsner closed this discussion on 18 Jun, 2021 09:03 PM.