A way to specify a sparse matrix

refack's Avatar

refack

08 Mar, 2017 08:25 PM

I'm curryntly using this config

image:
- Visual Studio 2015
- Visual Studio 2017 RC
environment:
  matrix:
    - GYP_MSVS_VERSION: "2010"
    - GYP_MSVS_VERSION: "2012"
    - GYP_MSVS_VERSION: "2013"
    - GYP_MSVS_VERSION: "2015"
    - GYP_MSVS_VERSION: "2017"
But I'm less interested in three of the combinations.
Image: Visual Studio 2017 RC; Environment: GYP_MSVS_VERSION=2010
Image: Visual Studio 2017 RC; Environment: GYP_MSVS_VERSION=2012
Image: Visual Studio 2017 RC; Environment: GYP_MSVS_VERSION=2013
And the following one should fail
Image: Visual Studio 2015; Environment: GYP_MSVS_VERSION=2017
Is there a better way to specify the matrix to include image? Or alternatively a way to figure out which image the job is on and make an API call to skip it?
  1. Support Staff 1 Posted by Ilya Finkelshte... on 08 Mar, 2017 09:59 PM

    Ilya Finkelshteyn's Avatar

    Hi Refael,

    We this this issue for quite a while. Sorry for pointing you for this old issue, I believe we will rise it's priority soon.

    For now I can propose you workaround, which is a bit of hack.

    • Allow those jobs to fail

    • Make them fail fast with something like this at init stage (not tested): - ps: IF (test-path 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community' -and $env:GYP_MSVS_VERSION -eq "2010") {throw}

    Please let us know if this helps.
    Ilya.

  2. 2 Posted by refack on 08 Mar, 2017 10:59 PM

    refack's Avatar

    Ha! How do I specify image in an allow_failures clause 🤓? Will this just work?

    matrix:
      allow_failures:
        - GYP_MSVS_VERSION: "2017"
          image: Visual Studio 2015
        - GYP_MSVS_VERSION: "2010"
          image: Visual Studio 2017 RC
        - GYP_MSVS_VERSION: "2012"
          image: Visual Studio 2017 RC
        - GYP_MSVS_VERSION: "2013"
          image: Visual Studio 2017 RC
    
    P.S. new feature https://github.com/appveyor/ci/issues/1373
  3. Support Staff 3 Posted by Ilya Finkelshte... on 09 Mar, 2017 01:20 AM

    Ilya Finkelshteyn's Avatar

    Tested it. This YAML works for me:

    image:
    - Visual Studio 2015
    - Visual Studio 2017 RC
    init:
    - ps: IF ((test-path 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community') -and ($env:GYP_MSVS_VERSION -eq "2013")) {throw}
    environment:
      matrix:
      - GYP_MSVS_VERSION: 2013
      - GYP_MSVS_VERSION: 2017
    matrix:
      allow_failures:
        - image: Visual Studio 2017 RC
          GYP_MSVS_VERSION: 2013
    

    The only difference is that I needed to wrap bool statements here ((test-path 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community') -and ($env:GYP_MSVS_VERSION -eq "2013")) into brackets to not confuse PowerShell.

    --ilya.

  4. 4 Posted by refack on 09 Mar, 2017 05:26 PM

    refack's Avatar

    Yep, works. Thanks!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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