Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Supporting two languages in travis.ci file

Tags:

travis-ci

I'm building a python package which is mostly c++ code (think numpy)

My travis file is currently

language: cpp
compiler:
  - gcc
  - clang
os:
  - linux
  - osx
dist: trusty

script: "make pcst_fast_test && ./pcst_fast_test"

notifications: 
...

But I've also written some python tests in a file called test_pcst_fast.py. Is there some way to call those from travis as well?

It seems ambiguous as to whether travis supports multiple languages in one file, but it seems like most people pull this off despite only listing one language under the language tag.

like image 498
Alex Lenail Avatar asked Mar 23 '17 21:03

Alex Lenail


People also ask

Which of the following are two main parts of Travis CI job?

The first job is to build the image and the second job is going to be to run the NPM test target.

Which of the following file is used to configure the Travis CI?

Configuration. Travis CI is configured by adding a file named . travis. yml , which is a YAML format text file, to the root directory of the repository.

Which of the following are among the minimal basic requirements to start working with Travis CI?

Prerequisites # To start using Travis CI, make sure you have: A GitHub or Bitbucket or GitLab or Assembla account. Owner permissions for a project hosted on GitHub or Bitbucket or GitLab or Assembla.

Is Travis CI a CI tool?

Like Jenkins, Travis CI is also one of the early players in the CI/CD tools market. The tool is written in Ruby and is developed & maintained by the Travis CI community. Travis CI was earlier available only for GitHub hosted projects but now it also supports Bitbucket hosted projects.


1 Answers

Travis doesn't support multiple languages per job yet.

Look at categories after_success and after_script in the Travis build lifecycle docs

Also, you can add more build scripts, they will run independently, just list them like this:

script:
    - "make pcst_fast_test && ./pcst_fast_test"
    - "./test_pcst_fast.py"

If there is no python installed (not sure about c builds), you can install it, check out this .travis.yml, it installs custom python interpreter as a dependency.

like image 113
Pavlus Avatar answered Sep 26 '22 20:09

Pavlus