Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Travis stages for multiple OS

Tags:

travis-ci

I'm setting up a .travis.yml where I need to - Build on two platforms - Deploy after all the builds completed

I started by creating a matrix for building

language: cpp
matrix:
  include:
    - os: osx
      osx_image: xcode10.1
      script:
      - "./Travis/build-osx.sh"

    - os: linux
      dist: trusty
      script:
        - "./Travis/build-linux.sh"

This runs correctly the two builds in parallel. The question is how can I add a stage that will run once the two builds completed.

This jobs documentation uses stages but it does not seem to work when I use a matrix

like image 321
Jan Avatar asked Jan 27 '23 07:01

Jan


1 Answers

So I managed to do this by having three stages, two having the same name. The stages with the same name run in parallel

language: cpp

notifications:
  email: false

jobs:
  include:
  - stage: build
    os: osx
    osx_image: xcode10.1
    script:
      - "./Travis/build-osx.sh"

  - stage: build        
    os: linux
    dist: trusty

    script:
      - ./Travis/build-linux.sh

  - stage: Deploy      
      - ./Travis/binaries-upload.sh
like image 70
Jan Avatar answered Feb 12 '23 10:02

Jan