简体   繁体   中英

Travis-ci C language Build matrix

I set-up a Travis-CI configuration file for my GitHub repository.

At the moment the main purpose of using Travis-CI is to avoid to test building for different targets every time I push, so in the script section of ".travis.yml" file I set the following script:

    script:
  - make V=1
  - make clean V=1
  - make
  - make clean
  - make bin
  - make clean_x V=1
  - make x V=1
  - make clean_x
  - make x

With this script section everything is sequentially built with 1 job (correctly at the moment), but it may cause state pollution since the result of one target compilation may depend from the state of the files built before.

In order to avoid this, and to make building more efficient, I would like to use a build matrix with different targets, but from the documentation that does not appear to be possible.

Is it possible? And how would you do it?

Best regards, A.

I solved the issue by myself by using "env" and a variable like this:

# Test different make targets
env:
 - COMMAND="V=1"
 - COMMAND="bin"
 - COMMAND="bin clean"
 - COMMAND=""
 - COMMAND="all"
 - COMMAND="clean"
 - COMMAND="lib x"
 - COMMAND="lib x V=1"
 - COMMAND="bin clean_x x V=1"

script:
  - make $COMMAND

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM