Override environment variable for matrix

Aaron's Avatar

Aaron

29 Jan, 2020 07:20 PM

I'm attempting to follow the documentation from here https://www.appveyor.com/blog/2018/04/25/specialized-build-matrix-c... to set an environment variable depending on teh platform. I've made lots of attempts but so far have not managed to get a configuration accepted.

Here's what I've got:

version: '{branch}.{build}'  
skip_tags: true  
image: Visual Studio 2019  
configuration: Release  
platform:  
 - Win32
 - x64
environment:  
  TRIPLET: 'x86-windows'
for:  
 -
   matrix:
     only:
       - platform: Win32
     environment:
       TRIPLET: 'x86-windows'
 -
   matrix:
     only:
       - platform: x64
     environment:
       TRIPLET: 'x64-windows'
 -

I am seeking to set the "TRIPLET" environment variable dependent on whether the "platform" ins Win32 or x64.

The error I get is:

"Error parsing appveyor.yml: Invalid "matrix" setting: environment (Line: 21, Column: 6)"

  1. Support Staff 1 Posted by Feodor Fitsner on 29 Jan, 2020 07:25 PM

    Feodor Fitsner's Avatar

    Looks like YAML padding is wrong. This one should work:

    version: '{branch}.{build}'  
    skip_tags: true  
    image: Visual Studio 2019  
    configuration: Release  
    platform:  
     - Win32
     - x64
    environment:  
      TRIPLET: 'x86-windows'
    for:  
     -
       matrix:
         only:
           - platform: Win32
       environment:
         TRIPLET: 'x86-windows'
     -
       matrix:
         only:
           - platform: x64
       environment:
         TRIPLET: 'x64-windows'
    
  2. Feodor Fitsner closed this discussion on 03 Apr, 2020 06:47 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