Matrix issues: confused with multi-platform build

I have the following config:

language: rust
cache: cargo

rust:
  - stable
  - beta
  - nightly

os:
  - linux
  - windows
  - osx

matrix:
  include:
    - os: linux
      dist: bionic
      addons:
        apt:
          packages:
            - libgtk-3-dev
            - python3
            - python3-pip
            - python3-setuptools
            - ninja-build
    - os: windows
      addons:
        apt:
          packages:
            - python3
    - os: osx
      addons:
        apt:
          packages:
            - python3
  allow_failures:
    - rust: nightly
  fast_finish: true

install:
  - pip3 install --user meson
  - rustup component add rustfmt

script:
  - cargo test --verbose
  - cargo test --verbose --features static

It’s currently run at https://travis-ci.org/MOZGIII/libui-sys - see https://travis-ci.org/MOZGIII/libui-sys/builds/578014802 for example.

The issue is is, pretty much, that travis is doing something completely unexpected to me. I just want to the same install and script steps run for every platform, but with different addons settings.

You’ll need to be a little more specific than this. What do you want to see happen? What is happening instead?

For one thing, you are using apt addon in all jobs, but it works only for Linux.

True, my bad.

I see two sets of “stable” jobs. Expected to only see one set of those: 3 stable, 3 beta and 3 nightly.

image

I’ll correct the apt use for linux and mac, that’s just a copy paste error.

You have a 3x3 matrix with

rust:
  - stable
  - beta
  - nightly

os:
  - linux
  - windows
  - osx

and additional 3 with matrix.include for a total of 12 jobs. See https://docs.travis-ci.com/user/customizing-the-build/#explicitly-including-jobs

The ones with rust: nightly are allowed to fail with allow_failures.

I see the problem now. You interpretation of what I wrote there really makes obvious, thank you.

Looks like I just have to remove the matrix.include steps. The only problem there is it looks like I need to run a chocolatey command to install python3 for windows runs, but I don’t know how to implement that. Any advice?

Imprint